On Feb 25, 7:36 pm, "
cartergilchr...@gmail.com"
<
cartergilchr...@gmail.com>wrote:
Quote
Hi there,
I have tried posting this in the jQuery group with no response, and
And if you had received a response, it would likely not have been from
a JavaScript programmer, but from a Web developer who plays one on the
Internet.
Quote
since it addresses a global design pattern, I'm wondering if someone
can help me here. Thanks!!
You came to the right place!
Quote
-----
I am going to be implementing jQuery on a very large enterprise level
website, and have a few questions with regards to some best-practices
Bad idea (to say the least.) Despite widespread use, jQuery is
completely inappropriate for use on the Web. Any script that treats
non-IE agents (e.g. mobile devices) as IE is a recipe for disaster.
Concerning this issue (and many similar ones), the jQuery community
has a "so what?" attitude, which is simply a front for a "what now?"
aptitude. Don't follow them into the abyss.
I wouldn't even recommend it for a private Intranet. The primary
author has been proven clueless about JavaScript and cross-browser
development. It makes no sense for an enterprise to rely on such a
person for JavaScript code.
Quote
for managing scripts.
Where is the best place to include all of the initialization code for
plugins? I'd like to keep everything external, but since the site is
so large, I can't put all of the dom.ready initilizers inside of one
big .js file (like jquery.com). I need to keep things split up for
specific sections of the site, and if a plugin is only required for
one specific page, do I create a new .js file just to run that
specific initializer, or do I bite the bullet and stick it in the
<head>of the page itself? I am trying to take advantage of browser-
cache as much as possible, which also makes a global .js file
unappealing since adding a snippet for one page would make browsers
have to dump the cache across the board, even if they never visit that
one page.
If functionality is specific to one page and you are fairly sure you
won't have to duplicate it for others in the future, then it makes
sense to put the initialization code in the head of the document.
For modules that are used for the majority of the pages, combine the
code in a single external file. Build additional files for section-
specific code.
Your goal should be to minimize the downloading of unused code.
Strategies to accomplish this are at odds with the concept of general
purpose do-everything JavaScript libraries.
Quote
Any suggestions or thoughts would be great, along with some examples
of other large sites that handle this problem well. Thanks very much!
When it comes to issues like this, it is hard to find good examples on
the Web. Most large sites are using large, monolithic libraries like
Prototype and jQuery and include the code in every page, whether they
need it or not.
-