overstimulate

ajax from file:/// urls?

Sat, 10 Sep 2005 comments

Supposedly the domain jail does not apply for file:/// urls. Mozilla documents in their XML Extras page that you should use

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");

to enable xmlhttprequest calls to foreign domains. Unfortunately it still fails to open a request to a http:// url,

req.open( 'GET', 'http://overstimulate.com' );

Any clues? Bad docs? Bug in mozilla? (it works in Safari)


Responses to "ajax from file:/// urls?"

  1. Sat, 10 Sep 2005 Carey Evans says:
    It works for me with the code below on Firefox 1.5 beta.
    <br  />function run_test() {
    <br  /> netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
    <br  /> var req = new XMLHttpRequest();
    <br  /> req.onreadystatechange = function () { handle(req); };
    <br  /> req.open("GET", "http://www.google.com/");
    <br  /> req.send(null);
    <br  />}
    <br  />function handle(req) {
    <br  /> if (req.readyState == 4) {
    <br  />  alert(req.status + ' ' + req.statusText);
    <br  /> }
    <br  />}
    The JavaScript Console window generally includes enough detail for me to work out why something isn't working. Speaking of which, your orange.css file gives: Error: Expected color but found 'fd0'.
  2. Sat, 10 Sep 2005 Jesse Andrews says:
    Carey, Thanks for both notes. Fixed the missing # in the css. And for some reason your javascript works for me ... My test code was very similiar but I'll have to check more when I get a little more sleep.

Leave a response

My Card Add to your Address Book

Jesse Andrews
open source, web browsers, web services, web sites & folk dancing. contacts/sites

Keep Up To Date

Get updates via RSS or
get email when I blog

Previous Blog Posts