prompt()函数在UIWebView IOS模拟器中返回undefined

prompt() function returns undefined in UIWebView IOS Simulator

本文关键字:模拟器 返回 undefined IOS UIWebView 函数 prompt      更新时间:2023-09-26
var x=prompt('Test Me','Default');
alert(x);

在Safari中运行-一切正常

从一个包装的UIWebView中运行这个,x返回undefined,不管输入是什么(在按下OK之后)。

这是一个bug -有解决方法吗?

注意:测试在6.0.1设备和Xcode模拟器(版本6.0 358.4)。

我刚刚试过了,它似乎工作得很好。尝试重命名变量,以防在其他地方使用变量名。如果可以的话,尝试在web浏览器中运行它,看看它是否会显示错误。欢呼:D