论坛上说可以这样做
document.write("<script lanague=\"javascript\" src=\"content.jsp\"><\/script>")
但我试过了,不行啊。能不能引用呢?能的话,到底要怎么才能成功引用并能在引用的JS中调用到被引用的JS文件中的函数呢

解决方案 »

  1.   

    在使用脚本的地方
    <script src="js1.jsp"></script>
    <script src="js2.js"></script>
    js2.js中就能引用了,只要让他们在同一个页面上就可以了
      

  2.   


    楼上正解。
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>MyHtml.html</title>

        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="this is my page">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        
        <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
            <script type="text/javascript" src="2.js"></script>
    <script type="text/javascript" src="1.js"></script>
      </head>
      
      <body>
        This is my HTML page. <br>
        JS test: <input type='button' name='b1' value='Inner JS' onclick=fn1();>
      </body>
    </html>
    2.jsfunction fn2(){
    alert('Hello World222!');
    }
    1.jsfunction fn1(){
    alert('Hello World1111!');
    fn2();
    }注意顺序,先2.js后1.js
      

  3.   

    script拆开
    document.write(" <scr"+"ipt lanague=\"javascript\" src=\"content.jsp\"> <\/scri"+"pt>")