且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows 8 Phonegap应用程序JQuery Mobile Security异常

更新时间:2022-12-19 18:11:00

我刚刚遇到同样的问题。看来,事情的根本在于WinJS安全模型将不允许JQuery dom操纵,当您从字符串中创建元素,例如。使用.html()方法。

I have just run into the same problem. It appears that the grist of the matter is that the WinJS security model won't allow the JQuery dom manipulation when you create elements from strings e.g. using the .html() method.

有关详细信息,请参阅以下内容:
http://blogs.msdn.com/b/windowsappdev /archive/2013/04/01/windows-store-app-support-in-jquery-version-2-0.aspx

See the below for more information: http://blogs.msdn.com/b/windowsappdev/archive/2013/04/01/windows-store-app-support-in-jquery-version-2-0.aspx

http://net.tutsplus.com / tutorials / javascript-ajax / building-windows-store-applications-with-jquery-2-0 /

总之,聪明的人已经在JQuery 2.0中修复此问题。

In summary the clever people have produced a fix to this in JQuery 2.0.

所以我将使用JQuery 2.0,但它将与JQuery Mobile?我还没有确定,所以我可能看看完全建立和附加dom元素,而不是使用.html()方法。

So I'll be looking at using JQuery 2.0 but will it work with JQuery Mobile? I haven't determined that yet so I'll probably look at fully building and attaching the dom elements rather than using the .html() method.

但请注意,我没有尝试过任何这些方法,所以不能保证它们的有效性。

But please note that I have not tried any of these approaches yet so cannot vouch for their validity.