using the original Ajax to invoke Domino's proxy is one of the simplest Ajax, of course, with jquery as well.
var xmlrole=new xmlhttpobject ("Get", "/filename/database name. nsf/proxy name? openagent&key=" +math.random (), False, ""); If it's not written, an agent executes once in session, giving a random number to avoid caching problems or timestamp
Xmlrole.senddata ();
var xmlresponse = Xmlrole.gettext (); Xmlresponse data for the background agent print
function Xmlhttpobject (method,url,syne,channel) {
/*
Function Description: Common operation XMLHttpRequest Object, and encapsulate it
Function call: Format: var xmlusersetting=new xmlhttpobject ("Get", Url,false, "Personal Workbench")
Xmlusersetting.senddata ();
Gets the textual content of the XML document: Xmlusersetting.gettext ();
Function parameters: The way method-sends the request [Post/get/put/propfind]; url-sends the URL of the request;
syne-synchronous or asynchronous mode [true/false];channel-current channel name, NOT null;
*/
var xmlhttp=null
var o=this
This.url=url
This. Syne=syne
This.method=method.touppercase (); Force method to uppercase
This.senddata = function ()
{
Create a XMLHttpRequest Object
if (window. XMLHttpRequest) {//To determine whether to implement XMLHttpRequest as a local JavaScript object
XMLHttp = new XMLHttpRequest (); Create an instance of the XMLHttpRequest (local JavaScript object)
}else if (window. ActiveXObject) {//Determine if ActiveX controls are supported
XMLHttp = new ActiveXObject ("Microsoft.XMLHTTP");//Create a XMLHttpRequest object by instantiating a new instance of ActiveXObject
}
With (XMLHttp) {
Open (' Get ', This.url, this. Syne);
onreadystatechange = O.processrequest;
Send (NULL);
}
}
This. Processrequest=function ()
{
if (xmlhttp.readystate = = 4) {//Judge object state
if (Xmlhttp.status = = 200) {//information has been successfully returned to start processing information
The operation after the XML has been successfully loaded [this method is not used yet]
}
}
}
This.gettext=function ()
{
if (xmlhttp==null) {return "the page you are requesting has an exception, try again. "}
if (xmlhttp.readystate = = 4) {//Judge object state
if (Xmlhttp.status = = 200) {//information has been successfully returned to start processing information
Break out the contents of the <body></body>
var xmlrestext = Xmlhttp.responsetext;
var L = xmlrestext.indexof ("<body");
L = Xmlrestext.indexof (">", L);
var r = xmlrestext.indexof ("</body>", L);
Xmlrestext = xmlrestext.substring (l+2,r-1);
Return Xmlrestext
}
}
Return xmlhttp.readystate
}
}