一个页面需要用到多个js文件,能否写在一个js文件里面多次调用getScript获取?

解决方案 »

  1.   


      $(document).ready(function() {
        $.getScript('a.js');
        $.getScript('b.js');
        $.getScript('c.js');
        $.getScript('d.js');
    });这样不行,该如何修改?
      

  2.   

    a.jsalert('a')
    b.jsalert('b')
    html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript" src="http://www.wanmei.com/public/js/jq_142.js"></script>
    <title>无标题文档</title>
    <script type="text/javascript">
    $(document).ready(function(){  
     
    $.getScript('a.js');
    $.getScript('b.js')
         
    }); 
    </script>
    </head>
    <body></body></html>我这OK 没问题
      

  3.   

    http://blog.csdn.net/fason/article/details/1374679