在Windows 8 Metro应用

问题描述:

使用煎茶触摸我想知道如何使用在Windows 8 Metro应用项目煎茶触摸框架与Windows JS项目。在Windows 8 Metro应用

当我尝试煎茶触摸到HTML页面中我收到异常

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. 

如果没有办法使用煎茶触摸框架是有什么办法煎茶ExtJS的添加到Windows 8 Metro应用

因为我们需要提供支持所有主要智能手机平台也。

建议欢迎。

取代

document.write(content); 

MSApp.execUnsafeLocalFunction(function() { 
     document.write(content); 
    }); 

developement.jstesting.jsproduction.js其我们在我们的应用程序中包含了这个技巧。具体而言,我们需要创建一个函数(),将document.write(content)作为该函数内的语句,然后将该函数作为MSApp.exeUnsafeLocalFunction()的参数传递。

+0

这确实有效....这些文件位于.sencha \ app目录。 –

+0

大感谢!!!!! –

+0

我有同样的问题,在development.js我的代码,并在index.html的也是我加入“winstore-compat.js”补丁取代,但它是不工作...任何线索?非常感谢 – inane

我相信你有包裹一些微加载代码在调用execUnsafeLocalFunction因为Windows CSP不喜欢EVAL文件撰写和核心煎茶触摸库中使用的一些其他位。

+1

我试过但没有工作。但不工作,我可能会错过一些东西。 – CoolMonster

我相信你,包括脚本,并在静态页面使用从它的功能,误差甚至会出现如果使用简单的JavaScript方法。要解决此问题,请使用Hub控件。 这里是MSDN链接毂快速启动 http://msdn.microsoft.com/en-us/library/windows/apps/dn412707.aspx