Thursday, July 7, 2011

AJAX Post Request in Lotus Notes

Following is a short abstract of how you can create AJAX POST request.


One can always find a way to create an XMLHTTPREQUEST and many cross browser solutions are available across the internet. eg w3schools. So if leave the function call in the very first line for you to code.



var mypostrequest=new ajaxRequest()

//handle the response

mypostrequest.onreadystatechange=function(){

if (mypostrequest.readyState==4){

if (mypostrequest.status==200

window.location.href.indexOf("http")==-1){

//handle your response here

}

}

}

//open a post request

mypostrequest.open("POST", “your agent url", true);

mypostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

//sample parameter

Var parameters = “label=value&process=post”

//send in the parameters to be processed in the lotus script agent

mypostrequest.send(parameters);

No comments:

Post a Comment