arams,vSuccess,vFailure,vHeaders);
},
Get:function(o)
{
var vMethod=o.method||"get";
var vUrl=o.url||null;
var vParams=o.params||"";
var vSuccess=o.success||null;
var vFailure=o.failure||null;
var vHeaders=o.headers||null;
if(vUrl==null||vUrl.length<1)
{
//alert("异步请求格式错误");
return;
}
this.getUrl(vMethod,vUrl,vParams,vSuccess,vFailure,vHeaders);
}
}
/**//*异步请求类 END*/
使用示例:
复制代码 代码如下:
1.//动态装载JS文件
if(vJS && vJS.length>3)
{
if(!_this.loadedJS.isInArray(vJS))
{
_this.loadedJS[_this.loadedJS.length]=vJS;
LeesAjaxRequest.Get({
url:vJS,
success:function(ojs){
var jsOBJ=document.createElement("script");
jsOBJ.text=ojs.responseText;
document.documentElement.appendChild(jsOBJ);
},//end success
headers:{Content_Type:"application/x-javascript"}
});//end Get
}//end if ( !_this.loadedJS.isInArray(vJS))
}//end if(vJS && vJS.length>3)
2 .//添加到工具提示竖条上
LeesAjaxRequest.Post({url:"/getToolTip.aspx",
params:{tooltip:title},
headers:{Content_Type:"application/x-www-form-urlencoded;charset=utf-8"},//如果使用Post方法,必须传入此参数,charset可以为别的
success:function(o){
var rObj=eval("("+o.responseText+")");
var tObj=new LeesBaseWindow(rObj["width"]+2,rObj["height"]+1,"","","","","",1,"");
tObj.ShowWindow(vToolBarSlider.window);
tObj.contentWindow.style.backgroundImage="url("+rObj["image"]+")";
tObj.contentWindow.style.marginLeft="1px";
tObj.contentWindow.style.backgroundRepeat="no-repeat";
tObj.contentWindow.style.backgroundPosition="0 0";
tObj.contentWindow.onmouseover=function(){
this.style.backgroundPosition="0 -"+rObj.height;
_this.setShowWindow(obj);
}
tObj.contentWindow.onmouseout=function(){
this.style.backgroundPosition="0 0";
}
},
failure:function(){
alert("生成ToolTip时出错");
}
});