From jQuery documentation for .load() :
jQuery uses the browser .innerHTML property to parse the extracted document and paste it into the current document. During this process, browsers often filter elements from a document, such as <html> , <title> , or <head> .
To load scripts, you must create the <script> elements in the <head> document yourself:
$('<script>', {src: 'js_file.js'}).appendTo('head');
Perhaps you can request a list of scripts to download from the server using ajax:
$.post('scripts_to_load.json', function (data) { for (var i = 0; i < data.scripts.length; i++) { $('<script>', {src: data.scripts[i]}).appendTo('head'); } });
David tang
source share