Scripts that contain functions go in the head section of the document. Then we can be sure that the script is loaded before the function is called.
英
美
- 将脚本中的函数插入head部分,这样就可以确保函数在被调用前已经加载完成。