Debug IE error Object expected [closed]

2019-02-19 13:08发布

问题:

I am trying to debug this error but it does not give me enough info ti figure it out? or does it???

http://c5beta.dealercontrol.net/inventory/1-2l1305517101/Mercedes-Benz_E-Class_E350_White_2010#request-info

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C) Timestamp: Fri, 3 Jun 2011 20:53:11 UTC

Message: Object expected Line: 1 Char: 1 Code: 0 URI: http://c5beta.dealercontrol.net/inventory/1-2l1305517101/Mercedes-Benz_E-Class_E350_White_2010

Message: Object expected Line: 1 Char: 1 Code: 0 URI:

Message: Object expected Line: 1 Char: 1 Code: 0 URI:

Message: Object expected Line: 1 Char: 1 Code: 0 URI:

回答1:

Without even seeing code, my gut tells me that you have a trailing comma somewhere inside an array or object literal. IE will choke on those with the Object expected error, usually at line 1 (which is meaningless).

Something like this:

var something = [
  "val1",
  "val2",
  "val3",
  "val4",
];
      ^^^^^


回答2:

Install IE9 and pray it produces the same error. Press F12 to open the developer console which is somewhat capable of doing useful debugging.

Have fun.



回答3:

You can install 'IEDeveloper' tool onto IE8 or IE7 (i guess you will not using IE6, if you are not lucky enough :)), and debug the page and that will show the exact location where the problem is , shortcut F12