开发者

objects in jQuery

开发者 https://www.devze.com 2022-12-30 00:28 出处:网络
I am having trouble understanding the meaning and more importantly the concept of an object as it relates to jQuery. I understand the basics that its a collection of data that comes in two forms, prop

I am having trouble understanding the meaning and more importantly the concept of an object as it relates to jQuery. I understand the basics that its a collection of data that comes in two forms, properties and methods but I kind of get lost on how it works beyond that. Can anyone point me to some good tutorials that may开发者_开发问答be helped you understand? I'm hoping to "Get it" once and for all.

Many many thanks for your help! =]


Remember that jQuery is just a library that runs in Javascript; what you are talking about is the concept of an object in Javascript.

The authority on this kind of thing is Douglas Crockford. I recommend this video as an introduction: http://video.yahoo.com/watch/630959/2974197


I always found this advanced JavaScript tutorial by John Resig to be very helpful.


Remember that JQuery is based on CSS. You select various part of your html (with css-alike selectors) and you can then use these parts like an object. This let you use the properties related to that object and various methods useful to modify it.

As a good introduction see this crash course and of course the jQuery documentation (always keep it open while coding with jQuery).


Understanding pure JavaScript first would be your first objective and learning how objects are defined there. I recommend the JavaScript: the definitive guide By David Flanagan.

Once understanding the JS model you can start looking under the hood of jQuery and understand what is being done. jQuery just takes advantage of the JavaScript language making an easy to use framework: http://www.learningjquery.com/2008/12/peeling-away-the-jquery-wrapper


jQuery is mainly used by way of "selectors". Basically, a selector is just a way to encapsulate any HTML elements matching your query. Once you have those items, jQuery can help you do all sorts of things to them.

I would highly recommend bookmarking (or downloading the AIR application for) the jQuery API, as it will greatly assist in learning what things you can do to your selectors.

I hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号