开发者

jquery 1.5 problem with append jscript file

开发者 https://www.devze.com 2023-02-08 09:18 出处:网络
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>\");

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 st开发者_运维知识库uffs
});

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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号