移动端的html页面,
写了一个函数.
function showAlert(msg,fn){
showDialog("alert", msg,"温馨提示",260);
if(isNull(fn) == false){
$("#SD_confirm").unbind("click");
$("#SD_confirm").bind("click",fn);
}
}
function exist(){
alert("aaa");
}
fn是一个函数,调用的时候我就写了
showAlert(json.msg,exist());
结果一到这行代码的时候,还没走到showDialog方法,就走exist弹出aaa了,这咋回事啊,后来才发现写错了.
应该写成
showAlert(json.msg,exist);
这样就会先弹出dialog温馨提示,然后点击确定才会弹出aaa.
妹的.原来是括号出的错.汗!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn