function prompt() { var answer = prompt("What is your name","") if (answer) { alert("Hello, " + answer + "!"); } }
提示堆栈溢出。我就纳闷了。
反复测试之后,发现原来函数名不能命名为prompt。
function prompttt() { var answer = prompt("What is your name","") if (answer) { alert("Hello, " + answer + "!"); } }
原文:http://blog.csdn.net/xyl295528322/article/details/26964835