durandal IE8 "undefined is null or not an object" error in viewEngine.js -


i above error in ie only. line throws error apparently

element.setattribute('data-view', viewid); 

in viewengine.js

createview: function(viewid) {         var = this;         var requirepath = this.convertviewidtorequirepath(viewid);         var existing = this.trygetviewfromcache(requirepath);          if (existing) {             return system.defer(function(dfd) {                 dfd.resolve(existing.clonenode(true));             }).promise();         }          return system.defer(function(dfd) {             system.acquire(requirepath).then(function(markup) {                 var element = that.processmarkup(markup);                 element.setattribute('data-view', viewid);                 that.putviewincache(requirepath, element);                 dfd.resolve(element.clonenode(true));             }).fail(function(err) {                 that.createfallbackview(viewid, requirepath, err).then(function(element) {                     element.setattribute('data-view', viewid);                     that.cache[requirepath] = element;                     dfd.resolve(element.clonenode(true));                 });             });         }).promise();     }, 

edit: narrowed down error happening between activate() , binding() in lifecycle. not sure if of help, though.

edit2: upon further investigation found processmarkup(markup) doesn't return htmldivelement should , other modules...

looks ie8 has issues setattribute method.

to solve try following:

use doctype

<!doctype html> 

and put in head of document

<meta http-equiv="x-ua-compatible" content="ie=edge" /> 

resource link: replace setattribute ie compatible script


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -