• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Object expected error on IE

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have some code working on firefox, but not on explorer, and the error I get isn't very clear ("Object expected").
I have this call to a js function (the onclick has the _ to be able to post this, it's ok on my page):



This should call this function:



In firefox, it works ok, it executes with no errors. When I run this on IE, I only get the "hi" alert, which is rigth before the call to the function, but I don't get the "inside showEventData", that is the first sentence of the function, so the error is somewhere in the middle. I suspect IE has some sort of a problem with the 'ORDER-3' parameter but I don't know.
Thanks a lot,
Pablo.
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it work when you omit the parameter? Why would you pass a parameter to a function that doesn't even reference it?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure that the id and name are the same thing on the element. IE freaks out.

Eric
 
Pablo M�ller
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies.
The parameter is referenced with the 'arguments' array, that contains all the arguments passed to the function.
I'm not using the name attribute anywhere in my page... should it be present and the same as id? I don't think so, I never had this problem before.
I tried passing nothing, redefining the function so that it only does an alert. Nothing worked. I guess it has some trouble to include the whole .js file because if I do: alert(functionName), where functionName represents every function of the .js, I get an undefined. I get undefined even with functions that only do alert("hello"). This is strange since it works on firefox.
I'll keep trying.
Is there any reason why the explorer won't recognize a .js that is working ok on firefox?
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there is an error in your Javascript, the remainder may not be loaded.
 
Pablo M�ller
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done,
Somewhere else I was evaluating a json object, and one of the attributes was called "class". Then, I was doing obj.class. It seems IE doesn't like that very much, but doesn't know how to tell you so.
Thanks again.
 
Bear Bibeault
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Debugging in IE is abysmal. I find it's best to incrementally test every step along the way.

That way, when something stops working, it's usually clear what broke.

Painful.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry if I'm stating the obvious. How do you include your
js file.

You have to use this format.



--Nimchi
 
Would you like to try a free sample? Today we are featuring tiny ads:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic