function loadJS (file) {
var js = $.ajax({
type: 'GET'
, url: file
, async: false
}).responseText; // No need to append
}
console.log('Test is loading...');
loadJS('test.js');
console.log('Test was loaded:', window.loadedModule); // loadedModule come from test.js
Комментариев нет:
Отправить комментарий