Hi.
Here is a small sample .xul file:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
title="Test"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/
there.is.only.xul">
<script>
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var url = ...;
dump("Requesting "+url+"\n");
var req = new XMLHttpRequest();
req.open('GET', url, false);
req.setRequestHeader('Content-Type', 'text/plain');
req.setRequestHeader('Accept', 'text/plain');
req.send(null);
alert(req.responseText);
}
catch(e) { alert(e); }
</script>
</window>
----------------------------------------
If I run this example in FF2 (2.0.0.6) or xulrunner-1.8.1.4,
everything works fine. But when I try to run it in FF3b5 or
xulrunner-1.9b4, it throws an exception:
[Exception... "Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005
(NS_ERROR_FAILURE)" location: "JS frame ::
chrome://moquicksearch/content/moquicksearch.xul
:: <TOP_LEVEL> :: line 30" data: no]
What's wrong with send() in FF3 ? Maybe I missed something? Thanks.
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network