Jquery mobile Windows 8 Phonegap应用程序JQuery移动安全异常

Jquery mobile Windows 8 Phonegap应用程序JQuery移动安全异常,jquery-mobile,windows-8,cordova,Jquery Mobile,Windows 8,Cordova,我使用PhoneGap2.9.0创建了一个Windows8项目,然后尝试在其中使用JQuery移动库。但我得到了以下安全例外。你知道怎么解决吗 Exception was thrown at line 4, column 7009 in ms-appx://c6a291ce-903f-47ab-b167- cb8378ffb051/www/libs/jquery.core/jquery-1.9.1.min.js 0x800c001c - JavaScript runtime error:

我使用PhoneGap2.9.0创建了一个Windows8项目,然后尝试在其中使用JQuery移动库。但我得到了以下安全例外。你知道怎么解决吗

Exception was thrown at line 4, column 7009 in ms-appx://c6a291ce-903f-47ab-b167-  cb8378ffb051/www/libs/jquery.core/jquery-1.9.1.min.js

 0x800c001c - JavaScript runtime error: Unable to add dynamic content. A script attempted    to inject dynamic content, or elements previously modified dynamically, that might be unsafe.   For example, using the innerHTML property to add script or malformed HTML will generate this   exception. Use the toStaticHTML method to filter dynamic content, or explicitly create   elements and attributes with a method such as createElement.  For more information, see   http://go.microsoft.com/fwlink/?LinkID=247104.

 If there is a handler for this exception, the program may be safely continued.

我刚刚遇到了同样的问题。问题的关键在于,当您从字符串(例如使用.html()方法)创建元素时,WinJS安全模型不允许JQuery dom操作

有关更多信息,请参见以下内容:

总之,聪明的人已经在jQuery2.0中对此进行了修复

因此,我将考虑使用jQuery2.0,但它是否适用于jQueryMobile?我还没有确定这一点,所以我可能会考虑完全构建和附加dom元素,而不是使用.html()方法


但请注意,我还没有尝试过这些方法中的任何一种,因此无法保证它们的有效性。

不久前问过同样的问题:不,这不是同一件事。这是用户定义的javascript。这是来自JQuery移动库本身。有人能帮我吗??。我真的被困在这里了:(.谢谢你的输入。我已经用JQuery 2.0替换了JQuery 1.9.1,解决了JQuery问题。但是我在JQuery Mobile 1.3.2和1.4.0 alpha版本中仍然遇到了同样的问题。你有什么想法我可以解决这些问题吗?.今天晚些时候,我放弃了使用它。html()并构建了我的DOM组件。