Dear All,i have a problem with a “simple” AJAX code. (see below)
i have a form on my lotus notes web application:
eg:
http://myProductionServer/mydatabase.nsf/TestAjax?OpenForm
on the form i have an HTML button that call an Ajax request on another domain server (non-Domino server):
httpObj.open(“GET”,“server.domain.com/plsql/testconnection”,true);
httpObj.send(null);
So,
The code works correctly if I execute the script on my local web database:
http://localhost/mydatabase.nsf/TestAjax?OpenForm
in this case i stay in a local intranet environment with IE 6 browser, when execute the code the IE ask me a messagebox for “protection problem”…if i click on ‘Yes’ the Ajax code on other domain server is correctly executed e returned (.readyState==4 and .status==200)
If I test the code on the production server:
http://myProductionServer/mydatabase.nsf/TestAjax?OpenForm
i have a javascript error on line:
httpObj.open(“GET”,vurl,true);
javascript error:
‘null’ is null or not an object.
no messagebox for “protection problem” is prompted.
here the sample javascript AJAX code:
doXMLHTTPGet(“server.domain.com/plsql/testconnection”);
function doXMLHTTPGet(vurl) {
var returnData = null;
if (window.XMLHttpRequest) {
//We are in a non-IE browser
httpObj=new XMLHttpRequest()
} else if (window.ActiveXObject) {
//We are in IE
httpObj=new ActiveXObject("Microsoft.XMLHTTP")
}
document.getElementById("txtmsg").innerHTML = "Check Connection....";
//Return the XML document when it has finished loading
httpObj.onreadystatechange= function()
{
if (httpObj.readyState==4)
{
if (httpObj.status==200)
{
//displayData(httpObj.responseXML);
alert("Correct Access on MAS Mission");
}
else
{
alert("Problem while accessing MAS Mission:" + httpObj.statusText)
//document.getElementById("txtmsg").innerHTML = "Problem while accessing MAS Mission:" + httpObj.statusText
}
}
}
//Request the XML document
httpObj.open("GET",vurl,true);
httpObj.send(null)
}
Can you help me ?