<script language="javascript" src="myjs.js">
</script>

解决方案 »

  1.   

    1  <script>
        function ac()
        {
         ///
         }
         </script>
         <input type=button onclick="ac()">2   <script language="javascript" src="my.js">
    </script>
      

  2.   

    它是从第一行开始执行,或通过function
      

  3.   

    <html>
    <head>
    </head>
    <body>
    </body><center>Hello!</center><script language="JavaScript">
    function SayHello()
    {
       window.alert("Hello!");
    }SayHello();
    </script></body>
    </html>