0x800c001c-JavaScript runtime error: Unable to add dynamic content.

edited July 2013 in Enyo 2
My Enyo code is ready and it is working fine
in Mozilla, and Chrome browser, when i am trying to build for windows 8 desktop app using the same source code
in my windows 8 wrapper it is showing the below error.

0x800c001c-JavaScript runtime error: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 inner HTML property to add scripter malformed HTML will generate this exception. Use the StaticHTML method to filter dynamic content,orexplicitily create elements and attributes with a method such as create Element.

Comments

  • Thanks wal. But we are using the Enyo MVC structure, where the code structure is different than that of Enyo 2.2, bootplate structure.
  • You'll still need to find a way to minify your application. The enyo.depends() mechanism won't work for Chrome Packaged Apps or Windows 8 apps, as neither environment allows adding script tags to a loaded page. This means all the JS code has to be loaded once at startup.
  • edited August 2013
    Thanks Ben for your reply.
    Now we have added the JavaScript file references directly into the head tag,
    instead of dynamically injecting during the run time by enyo.depends() method. Again we are getting the same error

    0x800c001c - JavaScript runtime error: 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 create Element. For more information, see http://go.microsoft.com/fwlink/?LinkID=247104.

    But the error location is different this time .
    previously we were getting the error at the script function.
    script: function(e, t, n) {
    if (!enyo.runtimeLoading) document.write('"); else {
    var r = document.createElement("script");
    r.src = e, r.onLoad = t, r.onError = n, document.getElementsByTagName("head")[0].appendChild(r);
    }
    
    After adding the references directly the error location changed to
    render into function()
    renderInto: function(e) {
    this.teardownRender();
    var t = enyo.dom.byId(e);
    return t == document.body ? this.setupBodyFitting() : this.fit && this.addClass("enyo-fit enyo-clip"), this.addClass("enyo-no-touch-action"), this.setupOverflowScrolling(), t.innerHTML = this.generateHtml(), this.generated && this.rendered(), this;
    },
  • What version of Enyo are you using? 2.2 and master both wrap the settting of innerHtml in a method that uses the safeExec feature.
  • edited August 2013
    I tried to run the Application by replacing the current enyo.js file with the recently downloaded bootplate2.2 enyo.js ( the master boot plate's enyo.js.)
    It is showing some error at the enyo.js as Router.js is present in the enyo.js of the My previous Enyo MVC App, but that reference is missing in the enyo.js of bootplate 2.2 that we have downloaded recently and used.

    The error location is :-(enyo.js)
    enyo.kind = function(e) {
    enyo._kindCtors = {};
    var t = e.name || "";
    delete e.name;
    var n = "kind" in e, r = e.kind;
    delete e.kind;
    var i = enyo.constructorForKind(r), s = i && i.prototype || null;
    if (n && r === undefined || i === undefined) {
    var o = r === undefined ? "undefined kind" : "unknown kind (" + r + ")";
    throw "enyo.kind: Attempt to subclass an " + o + ". Check dependencies for [" + (t || "") + "].";
    }
    The exact error is:-

    0x800a139e - JavaScript runtime error: enyo.kind: Attempt to subclass an unknown kind (enyo.Router). Check dependencies for [engine.Router].

  • enyo.Router is not part of Enyo 2.2, but was added after that release. You should grab bootplate from GitHub then run the commands
    git submodule foreach git checkout master
    git submodule foreach git pull
    to update to current development sources.
Sign In or Register to comment.