Connecting Tech Pros Worldwide Forums | Help | Site Map

pls help on xmlhttprequest

shotokan99
Guest
 
Posts: n/a
#1: Sep 6 '07
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.


Erwin Moller
Guest
 
Posts: n/a
#2: Sep 6 '07

re: pls help on xmlhttprequest


shotokan99 wrote:
Quote:
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-per...ttprequest.php

Erwin Moller
Closed Thread