<!--here to provide you with three kinds of dynamic loading JS jquery instance code Oh, because jquery is to provide users with convenience, so the use of jquery dynamic loading files as long as a word $.getscript ("test.js"); OK.
<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>jquery dynamic loading of JS three methods </title>
<script language= "Web Effects" >
$.getscript ("Test.js"); Method Two
function Loadjs (file) {
var head = $ (' head '). Remove (' #loadscript ');
$ ("<scri" + "pt>" + "</SCR" + "ipt>"). attr ({src:file,type: ' text/javascript ', ID: ' Load '}). Appendto (head);
}//Simple enough! If you're concentrating on the following, you can even use one line of code:
Method Three
$ ("<scri" + "pt>" + "</SCR" + "ipt>"). attr ({src:file,type: ' text/javascript ', ID: ' Load '}). Appendto ($ (' Head '). Remove (' #loadscript '));
</script>
<body>
</body>