我正在使用Javascript编写Windows 8应用程序。使用Windows 8模拟器测试我的应用程序时遇到此问题。这似乎是一个ui.js的bug。JavaScript运行时错误函数错误 - 最奇怪的错误
Exception was thrown but not handled in user code at line 22600, column 25 in ms-appx://microsoft.winjs.1.0.rc/js/ui.js
0x800a138f - JavaScript runtime error: Unable to get property 'style' of undefined or null reference
If there is a handler for this exception, the program may be safely cont
它指向这条线。
that._viewport.style.opacity = 1.0;
控制台日志
SCRIPT5007: Exception was thrown but not handled in user code at line 22600, column 25 in ms-appx://microsoft.winjs.1.0.rc/js/ui.js
0x800a138f - JavaScript runtime error: Unable to get property 'style' of undefined or null reference
File: ui.js, line: 22600 column: 25
更新: 今天2012年8月9日。当我运行我的应用程序时,它会在jquery.js和ui.js中生成一个更奇怪的错误。他们怎么了???
'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/1.0)'.
Exception was thrown at line 5200, column 4 in ms-appx://7034140f-baab-4c76-b27c-2a4c76641550/js/jquery.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 28908, column 30 in ms-appx://microsoft.winjs.1.0.rc/js/ui.js
0x80004005 - JavaScript runtime error: Incorrect function.
所以错误说'that._viewport'是未定义的。你有没有检查过这行的'that._viewport'引用。也许你应该显示更多的代码。 –
该文件来自Windows SDK。它怎么会抛出异常? :-S – Emerald214
你有没有封装测试用例,你可以弹出到保存箱或类似的东西?你写的代码是什么导致了错误? –