views:

32

answers:

1

I have a method in javascript that does the folowing:

 var X =  new XMLHttpRequest();
 X.open('GET',U,false);
 X.setRequestHeader('Content-Type','text/html');
 X.send('');    

where U = path to a file...example: xyz/abc.txt.

It works fine on firefox, but opening it on chrome gives me the following error:

Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101

It says error on X.send('').I tried

X.send(null); //did not work
X.send()     // did not work.

Any help on this is much appreciated. Thanks!

A: 

I get this error in chrome when I try and use XMLHttpRequest within a file launched my local hard drive. The script works file when run from a web server. I assume this is a security feature.

How are you launching the file containing the script above?

Greg