js:
dosave = function (){
alert("成功啦!");
}
错误写法一般有以下两种,很致命:
function dosave(){
alert("会报错!!");
}
和
var dosave = function (){
alert("会报错!!");
}
为什么会这样,因为:
html页面调用js文件里的函数,写法必须为dosave = function (){}形式,其他方式写,html页面会搜索不到该函数。
作者:ywltoread
来源:优快云
原文:https://blog.youkuaiyun.com/ywl570717586/article/details/53130863
版权声明:本文为博主原创文章,转载请附上博文链接!