Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Richard Maher" Newsgroups: comp.lang.java.programmer,comp.lang.javascript Subject: Re: JSObject.call(method, ARGS) with Safari Date: Sun, 22 Apr 2012 12:46:11 +0800 Organization: HTTP *is* The Box - Let's think outside Lines: 63 Message-ID: References: NNTP-Posting-Host: jOhPn0KFjrxwuMc9OPMmCw.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Response X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com comp.lang.java.programmer:13780 comp.lang.javascript:13521 "Daniel Pitts" wrote in message news:YOGkr.11325$DB1.340@newsfe03.iad... > On 4/21/12 3:12 AM, Richard Maher wrote: >> Hi. >> >> Has anyone been able to pass the ARGS parameter to JSObject's "call" >> method >> *and* pass arguments via the "args" parameter? An example of your >> work-around perhaps? >> >> I'm having no trouble calling methods on all sorts of complex Javascript >> objects but when it comes to passing the arguments array I keep getting >> nullpointerexception :-( >> >> Firefox, IE, Chrome, and Opera are all onboard and ok. >> >> Cheers Richard Maher > Not sure if this helps, but in the past I've had to do some hacky > work-arounds to work with JSObject. > > Check out: > > Hi Daniel, Thanks as always for your replies. > > Hope this helps, It certainly helped a couple of years ago (with FireFox 2.n or 3.0?) when you first showed me your cunning solution. That was my first (well probably about 5th as is happens) port of call. You may not recall, but that's when I first introduced the JS "Tier3Client.launder" function that just took a JSObject a a parameter and returned the same JSObject which was automagically fixed/rinsed. This worked well back in the day but now FF, IE, Chrome, and Opera (and JSObject) all seemed to have moved on and the "fix" was looking redundant - until Safari and its insistence on the "First Generation plug-in" :-( The problem is my solution is not working with Safari and I think Safari has other issues. I used to getMember("Tier3Client") on the applet window and then call my "launder" on that. If you look at the code I posted just before you'll see that I was trying to be "clever" and use an anonymous JS function to return a launder function. As this could well have been an issue, I reverted to the tried and tested method but still no joy. Anyway, I'll give your code/solution a go shortly but I'm not hopeful given that I can't even get a simple appletWindow.call("topLevelFunction", args) to do other than return "null". Without arguments is not a problem. So in the meantime if anyone knows of an example JSObject.call("sayHello", WITHargs) that works in Safari can they please provide a pointer? > Daniel. Cheers Richard Maher PS. NO *NOT bloody EVAL* - call, Call, CALL()!