[javascript] Is this how you define a function in jQuery?