这是一个利用XMLHTTP对象来调用代理的js函数的例子:
function RunAgent(sUrl,flag)
{
if(flag==null)flag=false;
var xDoc=new ActiveXObject("Microsoft.XMLDOM");
xDoc.async=flag;
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("Get",sUrl, flag);
xmlhttp.Send(xDoc);
return(xmlhttp.responseXML.text);
}