As with your other question about functions and variables, could you give a
specific example of some jQuery code that doesn't look good to you, and then
we can talk about how to clean it up?

One thing to keep in mind is that jQuery focuses pretty much on DOM
manipulation. It doesn't provide much help with creating and using objects,
but you can use any of the usual JavaScript techniques for these.

Also, you'll find that a lot of jQuery code uses closures where other code
might use traditional JS objects. It isn't required to use one or the other,
but often closures are a simpler solution.

-Mike

> From: Will
> 
> Does anyone know of a way to use class like objects in event 
> handling using jQuery?
> 
> For Example,
> 
> <input type='button' value='Button' onclick='Record.show()' />
> 
> where .show() is a method of the Record object.  This would 
> be really cool to be able to reuse the method name .show() 
> but with different objects verses just coding a huge list of 
> functions that are hard to organize and end up with long names.
> 
> Thanks
> 

Reply via email to