File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes method.call(..) throws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "method.call(..) throws "object doesn Watch "method.call(..) throws "object doesn New topic
Author

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

Sanjiv Jivan
Ranch Hand

Joined: Nov 03, 2005
Posts: 52
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Nov 03, 2005
Posts: 52
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: method.call(..) throws "object doesn't support this property" on some browsers