"Unable to add dynamic content" error even when using appendTo version of jQuery


  • Quite some time ago I attempted to port my HTML5 app to Windows 8 and I was disappointed because I received errors about inserting dynamic content. I know that a fix is to use a method to parse what I'm inserting although my app heavily relies on jQuery and so it wasn't possible for me to make the app work on Windows 8.

    I was very excited to see this: https://github.com/appendto/jquery-win8 which is a version of jQuery that plays nicely with Windows 8, however even when I use this version of jQuery inside my app, I still receive the error message of "Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe."

    Does anyone know why I still receive this error even though I'm using the appendTo version of jQuery? I realized that I can just include my app in a giant iFrame and it works, but then none of my cross-origin requests work from inside that iFrame. It looks like I'm quite stuck here and don't know how to resolve either of these issues.

    Friday, December 28, 2012 12:02 AM


  • Hi,

    I am strongly suggest you using winjs to handle the content add dynamically. Yes, you could use jquery in windows store app. But before you are using, you must test first.

    Any more question, please feel free to reply.

    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Friday, January 4, 2013 6:18 AM
    Friday, December 28, 2012 6:00 AM