I want to keep my commands in several separate JS files. How can I
load them into one main script?
On Nov 28, 12:58 am, [EMAIL PROTECTED] wrote:
> No, that does not work. For some reason the Utils.safeWrapper appears to be
> required. I wonder why?? Actual code is as follows:
>
> ...
> CmdUtils.injectJavascript(
> strJSUrl,
> Utils.safeWrapper( function() {
> var remoteObject = CmdUtils.getWindowInsecure().remoteObject;
> displayMessage( "Within callback " + remoteObject
> .remoteAttribute );
>
> //This is the bit I am having trouble with
> remoteObject.a( input.text, ???); // ??? is expected to be a
> string!
> })
> );
> ...
>
> In any case, I am happy to have moved ahead a bit. I come to a point where I
> can see the message notification.
>
> Here's a further question on how handling callbacks from methods within the
> external JS? Especially when it is a string??
> Doing the standard route with a
>
> remoteObject.a( input.text, function( data ) { displayMessage("data = " +
> data); } );
>
> does not work!
>
> Any pointers?
>
> tia..
>
> - Mayuresh
>
> On Thu, Nov 27, 2008 at 4:21 PM, gtdphp developers <[EMAIL PROTECTED]>wrote:
>
>
>
> > > But It's the callback bit I cant seem to
> > > fathom. I need to be able to do something on the lines of (this is
> > > pseudocode):
>
> > > var myRemoteScript = CmdUtils.injectJavascript( "http://xyz/script.js"
> > );
> > > var myRemoteObject = myRemoteScript.MyObject;
> > > myRemoteObject.a( some_params );
>
> > Try something like:
>
> > CmdUtils.injectJavascript( "http://xyz/script.js", function
> > myremotescript() {
> > var myRemoteObject = myRemoteScript.MyObject;
> > myRemoteObject.a(some_params);
> > });
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---