开发者

using javascript instead of jquery [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_开发技巧 Closed 11 years ago.

I find that using Javascript's OOP approach is easier when building a site because it allows for easier organization of objects. Jquery comes in handy if effects need to be applied, but if not, I find Javascript objects easier to get the job done with. Has anyone else had similar experience? Does anyone disagree?


Jquery is javascript, so I would disagree.


The only exclusivity between the two is the mental models you get trapped in as a developer. JQuery is borne out of DOM search / manipulation. It's brilliance, ubiquity, and extensibility have led people to write plugins that leverage JQuery to do tons of stuff unrelated to the original problem, and it's incredibly convenient to use these.

The conflict I think you're having is that using JQuery elevates DOM $(elements) to the primary, and for some developers only, object that javascript manipulates. In many web applications you need an independent javascript data model which sometimes interacts with the DOM. Read up on Backbone, Knockout, and MVC / MVVM design patterns if you want to get into this discussion seriously.


jQuery is a javascript library so if you write plain 'ol javascript to do something found in jQuery, you're reinventing the wheel. You can definitely use additional javascript in addition to jQuery where it's needed but there's rarely a good reason to ignore jQuery in favor of writing the javascript code from scratch.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜