Debug IE error Object expected

user782993 picture user782993 · Jun 3, 2011 · Viewed 27.9k times · Source

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:

Answer

Michael Berkowski picture Michael Berkowski · Jun 3, 2011

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",
];
      ^^^^^