Problem with xmlHttp.Open method

Hello everyone,

   In a notes database i use a form where i have created a HTML button(passthru HTML), which in turn calls a function. For e.g. My button code is as below:

Now on the same form’s JSHeader i have put the following code:

function triggerFunction(){

var xmlHttp=false;

try {

xmlHttp = new ActiveXObject(“Msxml2.XMLHTTP”);

} catch (e) {

try {

xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

} catch (e2) {

 xmlHttp = false;

}

}

if (!xmlHttp && typeof XMLHttpRequest != ‘undefined’) {

xmlHttp = new XMLHttpRequest();

}

// build the url to connect to

var url=“http://www.igotthisone.com/sindex.html”;

//open a connection to the server

xmlHttp.open(“POST”,url,false);

//check xmlhttp ready state and url status

if (xmlHttp.readyState==4) {

if (xmlHttp.status==200) alert(“URL Exists!”)

else if (xmlHttp.status==404) alert("URL doesn't exist!")

 else alert("Status is "+xmlHttp.status)

}

xmlHttp.send(null)

}

Iam just checking whether an URL exists or not !

now the problem is, when the execution reaches xmlHttp.Open method, An error is generated.

The error being generated is : uncaught exception: Permission denied to call method XMLHttpRequest.open

Ive detected this error using FireBug in FireFox. In IE neither ive got an error, nor ive got any response !

I have MSXML 4.0 SP2 and MSXML 4.0 SP2 Parser and SDK installed on the system.

What could be the cause for this error? Is it something to do with any settings in the Server document ? Or any kind of Database ACL settings? or something with the MSXML Parser/Version?

Help on this much apprecated !

Thanks in advance,

Jason.

Subject: Problem with xmlHttp.Open method

instead of xmlHttp.open(“POST”,url,false);

try with this code

xmlHttp.open(“Get”,url,false);

Subject: RE: Problem with xmlHttp.Open method

Hi Ashish,

Thanks for you reply. But still the problem persists. I tried Using “GET” “POST” “HEAD” etc. But couldn’t get a way out of this one. I think, it sould be something to do with access problem. Either in Server level or in Notes Database level…

Anyway thanks for your reply.

Jason.

Subject: Problem with xmlHttp.Open method

Have you tried relative urls for the server name like this:

var url=“/sindex.html”; //open a connection to the server

Are you posting to a different domain ?

HTH

Sai