标签:style blog io color sp java on div log
js是顺序执行的,但是在一个<script></script>标签中,后面的函数会预加载。如:
<script type="text/javascript">
try{
fun();
}catch(e){
alert("error");
}
function fun(){
alert("houhou");
}
</script>
输出为 houhou
如果是这样:
<script type="text/javascript">
try{
fun();
}catch(e){
alert("error");
}
</script>
<script type="text/javascript">
function fun(){
alert("houhou");
}
</script>
输出的就是 error
标签:style blog io color sp java on div log
原文地址:http://www.cnblogs.com/xiaoyueer/p/4154432.html