简体   繁体   English

使用Dojo在IE中创建样式对象时出错

[英]Error on creating style object in IE with Dojo

This code works well in FF but throws an error in IE v9: 这段代码在FF中效果很好,但在IE v9中抛出错误:

 var iconStyle = dojo.create('style', { innerHTML: '.ZMyToolbarBtn { background-image: url("../resources/toolbar/my.png"); }' }); dojo.doc.body.appendChild(iconStyle); 

要获得跨浏览器版本,最好使用dojox/html/styles

dojoxStyles.insertCssRule('ZMyToolbarBtn', 'background-image: url("../resources/toolbar/my.png");')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在IE8中创建对象时出错 - Error creating object in IE8 在IE6中一起edousing dojo.xhrPost和dijit.byID时发生对象错误 - object Error on epenusing dojo.xhrPost and dijit.byID together in IE6 Dojo 构建中的闭包编译器在 IE11 中使用 object 属性值简写创建语法错误 - Closure compiler in Dojo build creates syntax error in IE11 with object property value shorthand IE错误“样式”为null或不是对象-lightbox-resize.js - IE error 'Style' is null or not an object - lightbox-resize.js IE错误:无法设置属性“样式”的值:对象为null或未定义 - IE Error : Unable to set value of the property 'style': object is null or undefined Store为null或dojo中没有对象错误 - Store is null or not an object error in dojo 为什么创建一个样式对象来为组件提供样式在reacjs中显示随机错误? - why creating a style object to give style to the component show me random error in reacjs? 仅在IE中错误“ Dojo Widget”已使用该ID注册“ - Error Dojo Widget in IE only 'Already registered with that id ' 在JavaScript Dojo中创建对象时属性值意外地变成数组 - Attribute value turning into array unexpectedly when creating object in javascript dojo dojo / query样式(“ border-right”,“ 2px solid #CCC”)不适用于IE8,但适用于Chrome - dojo/query style(“border-right”, “2px solid #CCC”) not working on IE8, but work on Chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM