最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Internet Explorer line 1 char 1 code 0 error - Stack Overflow

programmeradmin2浏览0评论

I'm using jQuery+drupal and some jQuery plugins. All is ok with Firefox. But in IE's i'm receiving problem like this.

Line: 1 Char: 1 Error: object expected URL:

I have included .js files. How to know where is the problem? In which file? Line 1? Which file?

If you can please check site which I gave before.

I'm using jQuery+drupal and some jQuery plugins. All is ok with Firefox. But in IE's i'm receiving problem like this.

Line: 1 Char: 1 Error: object expected URL: http://businessway.am

I have included .js files. How to know where is the problem? In which file? Line 1? Which file?

If you can please check site which I gave before.

Share Improve this question asked Jan 25, 2010 at 14:47 toktiktoktik 1,9577 gold badges25 silver badges38 bronze badges 2
  • 1 I get the following error message: artNoStyleAdding is not defined businessway.am line: 84 – Billy Commented Jan 25, 2010 at 15:06
  • Billy what debugger are you using? – toktik Commented Jan 25, 2010 at 16:00
Add a comment  | 

5 Answers 5

Reset to default 8

You could get this type of errors in case the url of a <script src="...url..."></script> does not return javascript, but some other content (html)

I checked the page, but all scripts with src actually do seem to return javascript. With a bit more digging, it seems that this eval code triggers the error message:

artNoStyleAdding(document)

It looks like it is coming from this script:

<script type="text/javascript">if (Drupal.jsEnabled) {$(document).ready(function(){             window.setTimeout("artNoStyleAdding(document)", 2000);});}</script>

That's the last but one script in the head of the document.

Apperantly you forgot to declare and code the artNoStyleAdding function, whatever it is supposed to do.

I've seen this error come up in IE7 when you have a javascript object with an extra comma on the end.

Example:

  var something = {
    "one": ["a"],
    "two": ["b"],
  };

Should be:

  var something = {
    "one": ["a"],
    "two": ["b"]
  };

IE8, Chrome, and Firefox don't seem to mind it though.

I had this exact same error, only in IE, when putting comments in a certain spot:

function initMyUI() {
    $("#myId") // Don't put comments here.
        .delegate("#btnMyButton", "click", _clickDoSomeThings);
};

Depending on your version of IE you'll want to break out the development tools available. You can use Firebug Lite, built in dev tools in IE8 or go the old standby and use Web Developer Express.

The problem has been fixed in IE7 and IE8, but IE6 give's same error.

Updated: Fixed. Sorry :)

发布评论

评论列表(0)

  1. 暂无评论