Simple Ajax application example-pop-up layer

Source: Internet
Author: User

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 = "Please wait, loading... ";
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 = "error, error Code :" + obao. status;
}< BR >}< br> 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; // point to yourself
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;
}
}
Ajaxsimple application ‑release-Rar

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.