Question

I want to know how to use Sencha Touch Frame in windows 8 metro app project with Windows JS project.

When i try to add sencha Touch to html page i receive exception

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 no way to use Sencha touch framework is there any way to add Sencha ExtJS to windows 8 metro app.

Because we need to provide support all major Smart Phone platform also.

Suggestions are welcome.

Was it helpful?

Solution

replace

document.write(content);

with

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

in developement.js or testing.js or production.js which we included in our application will did that trick. Particulary we need create a function() with document.write(content) as statement inside that function then pass that function as argument for MSApp.exeUnsafeLocalFunction() will do that trick.

OTHER TIPS

I believe you have to wrap some of the microloader code in an execUnsafeLocalFunction call because the Windows CSP doesn't like eval, document.write and some other bits used in the core Sencha Touch library.

I believe you are including the script and using the functions from it in the static pages, the error will show up even if you use simple javascript methods. To solve this use a Hub control. Here is the msdn link for hub quickstart http://msdn.microsoft.com/en-us/library/windows/apps/dn412707.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top