1、在head中先引用了js文件再引用jquery,应先引用jquery 2、js文件中所有代码应包含在$(function(){ });中 转载于:https://www.cnblogs.com/family-626-77/p/5728392.html