AJAX简单应用实例-弹出层
程序员文章站
2022-03-25 21:01:08
function createobj() { if (window.activexobject) { &nb...
function createobj() {
if (window.activexobject) {
return(new activexobject("microsoft.xmlhttp"));
}
else if (window.xmlhttprequest) {
return(new xmlhttprequest());
}
}
function personalinfo() {
var obao=createobj();
var cont=document.getelementbyid("person_detial");
var cont_a=document.getelementbyid("person_content");
cont.style.display='block';
cont.style.cursor='pointer';
cont_a.innerhtml="请等待,加载中...";
var my_url="getinfo.asp?"+math.random();
obao.open("get",my_url,true);
obao.onreadystatechange=function(){
if(obao.readystate==4){
if(obao.status==200){
cont_a.innerhtml=obao.responsetext;
}else{
cont_a.innerhtml="出现错误,错误代码为:"+obao.status;
}
}
}
obao.send();
}
function drag(id)
{
var self=this;
this.obj=(typeof(id)=="string")?document.getelementbyid(id):id;
this.obj.onmousedown=function(e)
{
e=e||window.event;
var obj=self.obj;//指向自己
if(e.layerx){obj.position={x:e.layerx,y:e.layery};}
else{obj.position={x:e.offsetx,y:e.offsety};}
document.onmousemove=self.start;
document.onmouseup=self.end;
}
this.start=function(e)
{
e=e||event;
document.onselectstart = function(){ return false; };
window.getselection && window.getselection().removeallranges();
var obj=self.obj;
obj.style.left=e.clientx-obj.position.x+"px";
obj.style.top=e.clienty-obj.position.y+"px";
}
this.end=function(e)
{
e=e||event;
document.onmousemove = document.onmouseup = document.onselectstart = null;
}
}
ajax简单应用实例-弹出层.rar
if (window.activexobject) {
return(new activexobject("microsoft.xmlhttp"));
}
else if (window.xmlhttprequest) {
return(new xmlhttprequest());
}
}
function personalinfo() {
var obao=createobj();
var cont=document.getelementbyid("person_detial");
var cont_a=document.getelementbyid("person_content");
cont.style.display='block';
cont.style.cursor='pointer';
cont_a.innerhtml="请等待,加载中...";
var my_url="getinfo.asp?"+math.random();
obao.open("get",my_url,true);
obao.onreadystatechange=function(){
if(obao.readystate==4){
if(obao.status==200){
cont_a.innerhtml=obao.responsetext;
}else{
cont_a.innerhtml="出现错误,错误代码为:"+obao.status;
}
}
}
obao.send();
}
function drag(id)
{
var self=this;
this.obj=(typeof(id)=="string")?document.getelementbyid(id):id;
this.obj.onmousedown=function(e)
{
e=e||window.event;
var obj=self.obj;//指向自己
if(e.layerx){obj.position={x:e.layerx,y:e.layery};}
else{obj.position={x:e.offsetx,y:e.offsety};}
document.onmousemove=self.start;
document.onmouseup=self.end;
}
this.start=function(e)
{
e=e||event;
document.onselectstart = function(){ return false; };
window.getselection && window.getselection().removeallranges();
var obj=self.obj;
obj.style.left=e.clientx-obj.position.x+"px";
obj.style.top=e.clienty-obj.position.y+"px";
}
this.end=function(e)
{
e=e||event;
document.onmousemove = document.onmouseup = document.onselectstart = null;
}
}
ajax简单应用实例-弹出层.rar
上一篇: asp一句话木马原理分析
推荐阅读
-
iOS如何开发简单的手绘应用实例详解
-
ajax 文件上传应用简单实现_jquery
-
PHP+jQuery+Ajax实现分页效果 jPaginate插件的应用_php实例
-
asp.net ajax 简单实例
-
上传图片的时候,就弹出选择本map">
求php+ajax上传图片的实例!用的不是files,点击上传图片的时候,就弹出选择本map
-
用AJAX实现页面登陆以及注册用户名验证的简单实例
-
php+ajax实时刷新简单实例,phpajax实时实例
-
JS应用实例3:定时弹出广告
-
jquery实现弹出div,始终显示在屏幕正中间的简单实例
-
使用php+Ajax实现唯一校验实现代码[简单应用]_PHP