<html>
<body>
<input type="button" onclick="test()"/>
<script>
function test(){
  alert();
}
function onload(str){
  if(str == "test")
  //  break;//循环/switch以外怎么可以break呢?
  alert(111)
}
onload("test");
</script>
</body>
</html> 

解决方案 »

  1.   

    本来就没错
    <html> 
    <body> 
    <input type="button" onclick="test()"/> 
    <script>
    function test() 

      alert(""); 

    function onload(str) 

      if(str == "test") 
      return;

    onload("test"); 
    </script>
    </body> 
    </html> 
      

  2.   

    你什么问题?连<script></script>都不写,还看什么问题??
      

  3.   


    懒得理你了,,连看个问题都看不懂,你老去纠缠那段代码有什么意思啊,我是少打了"<script></script>"
    我的问题是要你看这段代码吗??
      

  4.   

    你这个和加载循序无关,语法有些问题<html> 
    <body> 
    <input type="button" onclick="test()"/> 
    <script>
    function test() 

      alert(1); //要注意这里,带参数

    function onload(str) 

      if(str == "test") 
        return; 

    onload("test"); 
    </script>
    </body> 
    </htm