These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:03 pm Advanced search

Local JS libraries

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Local JS libraries

Postby Mx64 » Mon Jan 18, 2010 2:29 pm

(I'm not sure if it's the right place, correct me if I'm wrong.)

1. What is the problem you are trying to solve?

I've been looking at Google's AJAX Libraries API recently and had an idea. Maybe I'm not even the first one to think about it. Why browsers do not have an ability to include Javascript libraries from their local source? If their size is large they don't need to be bundled with the browser itself but an ability to plug them in such a manner will decrease JS libraries load times and improve user's experience as a result.

2. What is the feature you are suggesting to help solve it?

New DOM(?) function loadLibrary():

Sample JS pseudo code:

Code: Select all
if(window.loadLibrary && window.loadLibrary("jquery", "1.4")){
    # Library is loaded. Nice.
}else{
    # Browser don't have this library,
    # requested version of it
    # or it does not understand this at all.
    # Load normally via script element from external source.
};


loadLibrary() should have an optional 3rd parameter for options too.

3. What is the processing model for that feature, including error handling?

It either loads and return true (all ok) or not and returns false (load manually as usual).

4. Why do you think browsers would implement this feature?

Currently JS support is somewhat inconsistent and lacking some now often used "web 2.0" UI features.

5. Why do you think authors would use this feature?

Mostly to improve user experience. This will reduce server load a bit too (no need to fetch a JS if it's already on user's side).

6. What evidence is there that this feature is desparately needed?

JS libraries tend to be quite large. + there are plugins for them like, say, jQuery UI (it should be possible to load it too in the same manner).
Mx64
<h6>
 
Posts: 5
Joined: Tue Jan 20, 2009 12:35 pm

Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest