jquery 1.5 problem with append jscript file

319 views Asked by At

hi guys this code was working on jquery 1.4.4 well

$(function(){
    $("head").append("<script src='jscript/helpdesk/core/classes/members.js' type='text/javascript'></script>");

var chkMember = $.validate_memberid();

});

but in jquery 1.5 this does'nt work . i think in 1.4.4 code was waiting for append or know append .js file but 1.5 run codes before script loaded :S any one know what to do ?

i don't want to use :

$.getScript('jscript/helpdesk/core/classes/members.js', function () {
     // do stuffs
});

cause i load many js files and unload them with append and remove :(

1

There are 1 answers

0
PetersenDidIt On

You should check out requireJS http://requirejs.org/

Sounds like you might have a lot dependent scripts, this will help you manage those.