Assuming that you are not running this code from google.com, that error
happens because of Same Origin Policy supported by all browsers. Basically
it means.that you can't do cross-domain XmlHttpRequest calls.

Anton
On May 23, 2011 6:21 AM, "nasi" <[email protected]> wrote:
> I am using the following code. when I run this code in eclipse it
> works but when I want to run it in chrome I get "XMLHttpRequest cannot
> load" error.
>
> var req = new XMLHttpRequest();
> req.open("get", 'http://www.google.com/search?
> hl=enrlz=1I7SKPB_en&q=query'&start=10&sa=N target="blank"'/", true);
> req.onreadystatechange = function(){ //instead of onreadystatechange
> //do something
> };
> req.send(null);
>
> I checked it with "req.onload" as well. but in that case it neither
> runs in eclipse nor chrome.
>
> do you have any idea?
>
> Thanks
>
> --
> To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to