pls help on xmlhttprequest

S

shotokan99

hi,

i wanted to check if the url is existing using xmlhttprequest. my
browser is firefox. the code goes like this:

window.onload=ini
var xr= new XMLHttpRequest();

function ini(){
xr.open("HEAD",
'http://www.google.com',
true);
xr.onreadystatechange=doit();
}

function doit(){
if(xr.readyState==4){
if(xr.status==200){alert('ok');}
else if(xr.status==404){alert('not ok');}
}
}//doit

upon running it gives me this error msg:
uncaught exception: Permission denied to call method
XMLHttpRequest.open

....what have gone wrong?
tnx.
 
E

Erwin Moller

shotokan99 said:
hi,

i wanted to check if the url is existing using xmlhttprequest. my
browser is firefox. the code goes like this:

window.onload=ini
var xr= new XMLHttpRequest();

function ini(){
xr.open("HEAD",
'http://www.google.com',
true);
xr.onreadystatechange=doit();
}

function doit(){
if(xr.readyState==4){
if(xr.status==200){alert('ok');}
else if(xr.status==404){alert('not ok');}
}
}//doit

upon running it gives me this error msg:
uncaught exception: Permission denied to call method
XMLHttpRequest.open

...what have gone wrong?
tnx.

Google for Permission denied to call method XMLHttpRequest.open

Follow first link:
http://www.captain.at/howto-ajax-permission-denied-xmlhttprequest.php

Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top