0

IE8 has been throwing this error at me

SCRIPT65535: Unexpected call to method or property access. load-scripts.php, line 4 character 25690

I removed a .js file from the code, and the error went away. I started commenting functions out, and narrowed it down to this one. With this one commented, I don't get the error. With it active, I do get it

$("title, .ab-item").each(function() {
    var text = $(this).text();
    text = text.replace("RepAgent", "Review Scout");
    $(this).text(text);
});

I've used JSHint and it says that it's valid?

4

2 回答 2

4

我很确定 Internet Explorer 不喜欢你弄乱<title>元素内容。无论如何,这并不是您设置文档标题的方式。刚刚设置document.title

于 2013-10-10T17:01:26.217 回答
1

jQuery 使用appendChild内部$.text().

虽然<title/>有一个appendChild-method(继承自HTMLElement),但这个方法可能不会被使用。(它也没有在title-methods中列出)

于 2013-10-10T17:13:30.170 回答