Raghuveersingh / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 0 forks source link

Feature Request : Add ability to load local library via a URL #642

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please add an option to load a generic JS library via a supplied URL

Here's why

In code I do

do_stuff_that_doesn't_need_libs_to_be_loaded

if (page_id = a/b/c) google.load(maps);
if (page_id = a/e/g) google.load(jqueryui);
if (page_id = h)     google.load(search);

It would be nice to simply add

if ( page_id = h )   google.load( 'local_file_1.js' )
if ( page_id = a/h ) google.load( 'local_file_2.js' )

before

google.setOnLoadCallback( do_stuff_that_needs_libs_to_be_loaded );

and piggy back on your 'load libs in parallel then fire callback when all libs 
loaded' functionality, 
rather than loading a second JS lib to do almost the same thing inside the 
setOnLoadCallback function's callback

I realise this extends the scope of what you do at the moment, but its a really 
great 'nice to have'

Cheers

Andrew

Original issue reported on code.google.com by aavmur...@gmail.com on 2 Nov 2012 at 7:31