简体   繁体   English

意外调用方法或属性。 在JQUERY

[英]Unexpected call to method or property access. in JQUERY

My code which is giving error in IE8 我的代码在IE8中给出了错误

$(function(){
 $.ajax({url:"http://localhost/css/register.txt",  
         cache : false,
         success:function(ris){$("<style></style>").appendTo("head").html(ris);//culprit statement
          },
         error:function(){}
                                    });
});

It seems that jQuery doesn't resolve the browser compatibility issues regarding setting the content of a <style> element via innerHTML . 似乎jQuery不能解决与通过innerHTML设置<style>元素的内容有关的浏览器兼容性问题。

I believe this will work instead... 我相信这可以代替...

$("<style>" + ris + "</style>")

Internet Explorer does not allow setting of innerHTML on <style> elements. Internet Explorer不允许在<style>元素上设置innerHTML See How to create a <style> tag with Javascript 请参见如何使用Javascript创建<style>标签

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

相关问题 意外调用方法或属性。 的jquery.js?版本1.7.1 = - Unexpected call to method or property access. jquery.js?ver=1.7.1 jQuery v1.8.3在ie 8中创建错误,即7“对方法或属性访问的意外调用”。 - jQuery v1.8.3 creating error in ie 8 and ie 7 “Unexpected call to method or property access.” 意外调用方法或属性。 微软客户关系管理 - Unexpected call to method or property access. MS CRM IE错误“意外调用方法或属性。 行:113字符:460代码:0” - IE Error “Unexpected call to method or property access. Line: 113 Char: 460 Code: 0” (仅在IE中)SCRIPT65535:对方法或属性访问的意外调用。 main.js,第152行字符28 - (Only in IE) SCRIPT65535: Unexpected call to method or property access. main.js, line 152 character 28 对方法或属性访问的意外调用? - unexpected call to method or property access? 在jQuery中对IE8上的方法或属性访问进行了意外调用 - Unexpected call to method or property access on IE8 in jQuery IE中出现奇怪的jQuery错误:对方法或属性访问的意外调用 - Strange jQuery error in IE: Unexpected call to method or property access jQuery .find()错误:“对方法或属性访问的意外调用” - jQuery .find() error: “Unexpected call to method or property access” JavaScript错误:对方法或属性访问的意外调用 - JavaScript Error:Unexpected Call To Method Or Property Access
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM