Its still possible - try loading it via jQuery.get() and eval() the 
result. jQuery.load() is another possibility, but I'm not sure if that 
will work within Ubiquity - I think it assumes there is a DOM available, 
which there isn't for Ubiquity commands.

You'll want to do that outside of any commands, so it loads on startup. 
You may need a mechanism to make sure none of your commands are 
available until the script is loaded however, or else you may get 
"unexpected" results.

So something like:

jQuery.get("http://mydomain.com/awesome.js";, function(js) {
   eval(js);

   CmdUtils.CreateComand( ... );
});


Hope that helps.

- Blair





On 7/11/2008 1:28 PM, Abimanyu Raja wrote:
> So, you want to run the JS from the webpage you are on? I don't think
> it's considered local.
>
> - Abi
>
> 2008/11/7 Douglas Nogueira <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>
>
>     Can i load a js from a page?
>     I find this:
>
>     "The |mozIJSSubScriptLoader| interface can be used from JS to load
>     and run JavaScript code from the given URL at run-time
>
>     method: loadSubScript (in wstring url[, targetObj]);
>
>     The URL pointing to the script to load. It*must*  be either 
> afile:,resource:,
>     or achrome:  URL, and/*_must be local_*/.*"*
>
>
>
>     in the site: https://developer.mozilla.org/en/mozIJSSubScriptLoader
>
>     But i can use that on ubiquity, having a tab of the page? Is it
>     considered local?
>
>     --
>     Douglas
>
>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to