The question is: should I use always jQuery in some large jQuery project? Imagine you’re developing a large scale web application where the JavaScript part of it is supported by jQuery. In my case that was the reality. In fact in every, even very big, project there are “pages” where you don’t need much of JavaScript. Such pages can be the “about”, “info” or whatever static page there is.

Well the question is, should I again include the hole jQuery if I need only to toggle the visiblity on a DIV element? Let’s assume you’ve very long text, cutted in the beggining with the “more” link somewhere after the intro. That’s very common, isn’t it? So by clicking on the “more” you toggle the visibility of the rest of the text. Well of course it’s absurt if I include the entire library just to make this.

The right answer by me is to use pure JavaScript, something like that:

document.getElementId('id').style.display = 'block'

That will do the same job without to block the “fast” in other way page!

Related posts:

  1. Toggle the visibility with jQuery
  2. clickoutside jQuery plugin
  3. Google Closure Compiler?