在Win8的应用使用AppendTo / jQuery的,win8的 [英] Using AppendTo/jquery-win8 in Win8 apps
问题描述
我不自禁地看 ToDoMVC 样本,试图通过它们移植到Win8的JS应用只是复制和粘贴的code,但也有相关的WinJS库引用。
I am tempting to look at the ToDoMVC samples and have tried porting them to a Win8 JS app by just copying and pasting the code but also having the relevant WinJS libs referenced.
由于各地的innerHTML等MS安全主体我已经提到 jQuery的,Win8的它试图获取解决此问题然而,在当我运行应用程序的角度和骨干的例子我得到的appendChild异常
Due to MS security principals around InnerHTML etc I have referenced jQuery-Win8 which attempts to get around the issue however in the Angular and Backbone examples when I run the app I get an exception on appendChild
我在一些地方读过,你应该能够继续运行应用程序,但如果我这样做preSS应用反正关闭例外的继续。
I've read in some places you should be able to continue running the app but if I do press Continue on the exception the app shuts down anyway.
任何人都可以点我在正确的方向得到这个运行?
Can anyone point me in the right direction to get this running?
感谢
推荐答案
appendTo的版本中删除在加载时运行的jQuery时发生的错误。你仍然可以有code违反安全模型微软到位。微软试图让你知道,有将未消毒的标记到页面的风险。
appendTo's version removes errors that occur when running jQuery at load time. You still may have code that violates the security model Microsoft put in place. Microsoft is trying to make you aware that there is a risk adding un-sanitized markup to your page.
如果你有信心,是不是你可以尝试设置的情况下 jQuery.isUnsafe
到真正
后appendTo库包括在内。这应该与包装 MSApp.execUnsafeLocalFunction
所有可能不安全的电话,以微软并没有抱怨。
If you are confident that is not the case you can try setting jQuery.isUnsafe
to true
after the appendTo library is included. That should wrap all possible unsafe calls with MSApp.execUnsafeLocalFunction
so that Microsoft doesn't complain.
注:此标志默认为关闭
这篇关于在Win8的应用使用AppendTo / jQuery的,win8的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!