Loading scripts using jQuery

Posted by Nimbuz on Stack Overflow See other posts from Stack Overflow or by Nimbuz
Published on 2010-05-21T04:18:43Z Indexed on 2010/05/21 4:20 UTC
Read the original article Hit count: 178

Filed under:
|
|
|
|
$.ajax({ url: "plugin.js", dataType: 'script', cache: true, success: function() {
    alert('loaded');
}});

1) I can't get the script to load, probably due to incorrect path, but how do I determine the correct path? The above code is in init.js, plugin.js is also in the same folder.

2) Can I load multiple plugins at once with the same request? eg. plugin.js, anotherplugin.js?

Thanks for your help

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery