--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-la...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=.
Just to anybody who would be as lost as I was where actually the
script is, this is more complete example (it's better to use
script.innerHTML in XMLHTTPRequest instead of script.scr, because then
we don't have to deal with waiting on loading of the script, and we
can be sure, that it is already loaded):
var XMLRPCMessage = {};
var req = new XMLHttpRequest();
req.open("GET","http://mcepl.fedorapeople.org/scripts/
xmlrpc.js",true);
req.onreadystatechange = function (aEvt) {
if (req.readyState == 4) {
if (req.status == 200) {
var thisDoc = jetpack.tabs.focused.contentDocument;
var script = thisDoc.createElement("script");
script.setAttribute("type","text/javascript");
script.innerHTML = req.responseText;
thisDoc.getElementsByTagName("head")[0].appendChild
(script);
XMLRPCMessage =
jetpack.tabs.focused.contentWindow.wrappedJSObject.XMLRPCMessage;
}
}
};
req.send("");
(of course, $.get() can be used instead, but I prefer plain Javascript
to jQuery)