js函数可以先使用后定义


<SCRIPT LANGUAGE="JavaScript"> 


function hello(name){alert("hello " +name)}; 

</SCRIPT>

<SCRIPT LANGUAGE="JavaScript"> 
hello('www.openj.cn'); 



</SCRIPT> 
这样可以!
----------------------------------------------------------------------------------

<SCRIPT LANGUAGE="JavaScript"> 
hello('www.openj.cn'); 
</SCRIPT> 

<SCRIPT LANGUAGE="JavaScript"> 


function hello(name){alert("hello " +name)}; 

</SCRIPT>

分开写两个js标签里先调用后定义不行!!
--------------------------------------------------------------------------------------------


<SCRIPT LANGUAGE="JavaScript"> 
hello('www.openj.cn'); 

function hello(name){alert("hello " +name)}; 

</SCRIPT>
同意个js标签内可以先调用再定义
----------------------------------------------------------------------------------------

你可能感兴趣的:(js函数可以先使用后定义)