1、定义几个方法
2、依次执行函数,代码写在前面的先执行,写在后面的后执行
示例:
function f1(){//定义f1函数}
function f2(){//定义f2函数
}
f1()//先执行f1函数
f2()//再执行f2函数
1、定义几个方法2、依次执行函数,代码写在前面的先执行,写在后面的后执行
示例:
function <a href="https://www.baidu.com/s?wd=f1&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YkrAfsmWm3ujc3PAnvm1w-0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3ErH61PjD1rjR1rjTkn16sPjR4" target="_blank" class="baidu-highlight">f1</a>(){//定义<a href="https://www.baidu.com/s?wd=f1&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YkrAfsmWm3ujc3PAnvm1w-0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3ErH61PjD1rjR1rjTkn16sPjR4"target="_blank" class="baidu-highlight">f1</a>函数
}
function f2(){//定义f2函数
}
<a href="https://www.baidu.com/s?wd=f1&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YkrAfsmWm3ujc3PAnvm1w-0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3ErH61PjD1rjR1rjTkn16sPjR4" target="_blank" class="baidu-highlight">f1</a>()//先执行f1函数
f2()//再执行f2函数