由于奇怪的行为而重新安装 Internet Explorer?
我在使用 IE 时遇到了奇怪的行为:
在对我的启用 Javascript 的网页进行一些修改后,IE9 无法正确测试字符串值。 我在 Safari 和 Firefox 上尝试了相同的页面,它工作正常(谁说没有惊喜?)...
此外,当使用 Visual Studio 集成的 localHost 引擎本地运行时,修改后的页面运行良好! 一旦页面上传并从主机网站(ASP.NET 4.0)运行,它就无法正常“工作”......
现在我在另一台装有 IE8 的电脑上尝试......它工作正常!
我怀疑我必须在我的电脑上重新安装 IE9?
Q1 - 您的网络专家怎么说? Q2 - 如何在 Windows Vista 上重新安装 IE?
更新:在我添加了 4 个字符长度的字符串变量并进行如下测试后,发生了不良行为:
var a = "abcd"; // 实际上是从隐藏字段中获取的值
if (a[2] == somevalue) { Do this } else { Do that }
没有脚本错误,但分支的结果是错误的!
I'm having a weird behavior with IE:
After some modifications on a Javascript enabled web page of mine, IE9 is not testing a string value correctly.
I tried the same page on Safari and Firefox and it works (Who said no surprise?)...
Besides, when running locally with the Visual Studio integrated localHost engine, the modified page runs fine!
Once the page is uploaded and run from the host website (ASP.NET 4.0) It doesn't "work" properly...
Now I tried on another PC with IE8 and... it works fine!
I suspect I have to reinstall IE9 on my PC?
Q1 - What do you web Gurus say?
Q2 - How to reinstall IE on Windows Vista?
Update: the bad behavior happened after I added a string variable of 4 chars length and testing like this:
var a = "abcd"; // Actually a value taken from a hidden field
if (a[2] == somevalue) { Do this } else { Do that }
There is NO SCRIPT ERROR, but the result of the branching is wrong!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IE9 有一个奇怪的错误行为:
var a = "abcd"; // 实际上是从隐藏字段获取的值
if (a[2] == somevalue) { Do this } else { Do that }
a[2] 保持“未定义”!
如果你想让它工作,你必须使用 javascript 子字符串函数。
在 Firefiox 和 Safari 中,a[2] 得到了完美的定义。
并且使用 Visual Studio 提供的 Localhost 也可以正常工作! :-((
There is a bizarre misbehavior with IE9:
var a = "abcd"; // Actually a value taken from a hidden field
if (a[2] == somevalue) { Do this } else { Do that }
a[2] stays "undefined"!
If you want it to work you must use the javascript substring function instead.
With Firefiox and Safari, a[2] is perfectly defined.
And with the Localhost provided by Visual Studio it works fine as well!!! :-((