<html> 
<script> 
var mm=function() 

alert('555'); 

mm();
</script> 
</html> 

解决方案 »

  1.   


    <!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" />
    <title>无标题文档</title>
    </head>
    <script language="javascript">
    var mm=function() 

    alert('555'); 

    mm();
    </script>
    <body>
    </body>
    </html>
      

  2.   

    <!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" />
    <title>无标题文档</title>
    </head>
    <script language="javascript">
    var mm=function() 

        alert('555'); 

    mm();
    </script>
    <body>
    </body>
    </html>
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> alert </TITLE>
     </HEAD>
    <script> 
    var mm=function() 

    alert('555'); 

    </script>  <BODY>
      <input type="button" value=" 点我我就弹!" onclick="mm()"/>
     </BODY>
    </HTML>
      

  4.   

    <html> 
    <script> 
    var mm=function() 

    alert('555'); 

    window.onload=mm;
    </script> 
    </html> 
      

  5.   

    还可以在body上用!<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
    <HTML> 
    <HEAD> 
      <TITLE> alert </TITLE> 
    </HEAD> 
    <script> 
    var mm=function() 

    alert('555'); 

    </script> <BODY onLoad=mm> 
    </BODY> 
    </HTML> 
      

  6.   

    <html> 
    <script> 
    var mm=function() 

    alert('555'); 

    window.onload=mm; 
    </script> 
    </html> 
      

  7.   


    <html>
    <head>
    <script language="javascript">
    function mm() 

        alert('555'); 
    }
    </script>
    </head>
    <body onload="mm()">
    </body>
    </html>
      

  8.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
    <HTML> 
    <HEAD> 
      <TITLE> alert </TITLE> 
    </HEAD> 
    <script> 
    var mm=function() 

    alert('555'); 

    </script> <BODY> 
      <input type="button" value="測試" onclick="mm()"/> 
    </BODY> 
    </HTML> ps:mm就是函數名
      

  9.   

    <html> 
    <script> 
    var mm=function() 

    alert('555'); 

    mm(); 
    </script> 
    </html> 
      

  10.   

    <html> 
    <script> 
    var mm=function() 

    alert('555'); 

    window.onload=mm; 
    </script> 
    </html>