• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

method.call(..) throws "object doesn't support this property" on some browsers

 
Sanjiv Jivan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a call in prototype
__method.call(object, event || window.event);

which works fine on several machines which have IE 6 however on a couple of them (also running IE 6) it throws the exception "Object doesn't support this property or method".

Any idea why I'm seeing this error? The "call(..)" function is part of JS, right? Or is it possible I have an older JS engine.

Thanks,
Sanjiv
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call is not supported in IE 5 and under.

I am guessing that your object reference is not there when you are trying to make a call.

How to debug? Well it will be tough. You need to examine the object to see if it actually contains one.

if(typeof yourObjectRef != "object")alert("AHHHH");

Eric
 
Sanjiv Jivan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code is in the prototype library (prototype.js) and works fine in many IE 6 browsers. The very same page just breaks on a couple of machines where I suspect the JS engine maybe older although the browser version is IE 6. Is there a quick way to determine the JS engine version.

I ran my code through a JS debugger and (typeof __method) returns "function".

Thanks,
Sanjiv
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic