Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13780

Re: JSObject.call(method, ARGS) with Safari

From "Richard Maher" <maher_rj@hotspamnotmail.com>
Newsgroups comp.lang.java.programmer, comp.lang.javascript
Subject Re: JSObject.call(method, ARGS) with Safari
Date 2012-04-22 12:46 +0800
Organization HTTP *is* The Box - Let's think outside
Message-ID <jn02en$5gp$1@speranza.aioe.org> (permalink)
References <jmu16i$ij2$1@speranza.aioe.org> <YOGkr.11325$DB1.340@newsfe03.iad>

Cross-posted to 2 groups.

Show all headers | View raw


"Daniel Pitts" <newsgroup.nospam@virtualinfinity.net> 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: 
> <http://virtualinfinity.net/wordpress/tools/2008/10/11/javascript-and-java-applets/>
>

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()! 

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JSObject.call(method, ARGS) with Safari "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-21 18:12 +0800
  Re: JSObject.call(method, ARGS) with Safari "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-21 18:15 +0800
    Re: JSObject.call(method, ARGS) with Safari Lew <noone@lewscanon.com> - 2012-04-21 04:45 -0700
      Re: JSObject.call(method, ARGS) with Safari Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-21 09:57 -0300
        Re: JSObject.call(method, ARGS) with Safari "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-21 21:30 +0800
          Re: JSObject.call(method, ARGS) with Safari Lew <noone@lewscanon.com> - 2012-04-21 13:07 -0700
        Re: JSObject.call(method, ARGS) with Safari Lew <noone@lewscanon.com> - 2012-04-21 13:00 -0700
  Re: JSObject.call(method, ARGS) with Safari Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-21 15:48 -0700
    Re: JSObject.call(method, ARGS) with Safari "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-22 12:46 +0800
      Re: JSObject.call(method, ARGS) with Safari "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-22 15:07 +0800
        Re: JSObject.call(method, ARGS) with Safari Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-22 21:17 -0300
          Re: JSObject.call(method, ARGS) with Safari Richard Maher <maherrj@googlemail.com> - 2012-04-22 23:40 -0700
            Re: JSObject.call(method, ARGS) with Safari Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-23 20:40 -0300

csiph-web