How to set the page to wait after submission

Source: Internet
Author: User

Var oProgressLayer = null;
/*************************************** **************************************** *****************
// Set all elements on the Web page to events that are not responsive, and set the mouse cursor to wait
**************************************** **************************************** *****************/
Function SetBusy (){
For (var iCnt = 0; iCnt <document. all. length; iCnt ++ ){
Try {document. all [iCnt]. oldCursor = document. all [iCnt]. style. cursor;
Document. all [iCnt]. style. cursor = 'wait';} catch (e ){;}
Try {document. all [iCnt]. oldonmousedown = document. all [iCnt]. onmousedown;
Document. all [iCnt]. onmousedown = function () {return false ;}} catch (e ){;}
Try {document. all [iCnt]. oldonclick = document. all [iCnt]. onclick;
Document. all [iCnt]. onclick = function () {return false ;}} catch (e ){;}
Try {document. all [iCnt]. oldonmouseover = document. all [iCnt]. onmouseover;
Document. all [iCnt]. onmouseover = function () {return false ;}} catch (e ){;}
Try {document. all [iCnt]. oldonmousemove = document. all [iCnt]. onmousemove;
Document. all [iCnt]. onmousemove = function () {return false ;}} catch (e ){;}
Try {document. all [iCnt]. oldonkeydown = document. all [iCnt]. onkeydown;
Document. all [iCnt]. onkeydown = function () {return false ;}} catch (e ){;}
Try {document. all [iCnt]. oldoncontextmenu = document. all [iCnt]. oncontextmenu;
Document. all [iCnt]. oncontextmenu = function () {return false ;}} catch (e ){;}
Try {document. all [iCnt]. oldonselectstart = document. all [iCnt]. onselectstart;
Document. all [iCnt]. onselectstart = function () {return false ;}} catch (e ){;}
}
}
/*************************************** **************************************** *****************
// Restore all elements on the webpage to respond to events and set the default cursor of the mouse cursor
**************************************** **************************************** *****************/
Function ReleaseBusy (){
For (var iCnt = 0; iCnt <document. all. length; iCnt ++ ){
Try {document. all [iCnt]. style. cursor = document. all [iCnt]. oldCursor;} catch (e ){;}
Try {document. all [iCnt]. onmousedown = document. all [iCnt]. oldonmousedown;} catch (e ){;}
Try {document. all [iCnt]. onclick = document. all [iCnt]. oldonclick;} catch (e ){;}
Try {document. all [iCnt]. onmouseover = document. all [iCnt]. oldonmouseover;} catch (e ){;}
Try {document. all [iCnt]. onmousemove = document. all [iCnt]. oldonmousemove;} catch (e ){;}
Try {document. all [iCnt]. onkeydown = document. all [iCnt]. oldonkeydown;} catch (e ){;}
Try {document. all [iCnt]. oncontextmenu = document. all [iCnt]. oldoncontextmenu;} catch (e ){;}
Try {document. all [iCnt]. onselectstart = document. all [iCnt]. oldonselectstart;} catch (e ){;}
}
}
/*************************************** **************************************** *****************
// Close the "processing" dialog box
**************************************** **************************************** *****************/
Function HideProgressInfo (){
If (oProgressLayer ){
// ReleaseBusy ();
OProgressLayer. removeNode (true );
OProgressLayer = null;
}
}
/*************************************** **************************************** *****************
// Display the animation cursor style in the "processing" dialog box (style 1)
**************************************** **************************************** *****************/
Function ShowProgressInfo (){

If (oProgressLayer) return;
OProgressLayer = document. createElement ('div ');
With (oProgressLayer. style ){
Width = '230px ';
Height = '70px ';
Position = 'absolute ';
Left = (document. body. clientWidth-230)> 1;
Top = (document. body. clientHeight-70)> 1;
BackgroundColor = 'buttonface ';
BorderLeft = 'solid 1px silver ';
BorderTop = 'solid 1px silver ';
BorderRight = 'solid 1px gray ';
BorderBottom = 'solid 1px gray ';
FontWeight = '000000 ';
FontSize = '13px ';
ZIndex = '20140901 ';
}
OProgressLayer. innerHTML =
'<Table border = "0" cellspacing = "0" cellpadding = "0" width = "100%" height = "100%">' +
'<Tr>' +
'<Td align = "center" valign = "middle">' +
'' +
'& Nbsp; processing data. Please wait ...... '+
'</Td>' +
'</Tr>' +
'</Table> ';
Document. body. appendChild (oProgressLayer );
// SetBusy ();
}
/*************************************** **************************************** *****************
// Display the progress bar style in the "processing" dialog box (Style 2)
**************************************** **************************************** *****************/
Function ShowProgressInfo1 (message ){
If (oProgressLayer) return;
// SetBusy ();

OProgressLayer = document. createElement ('div ');
With (oProgressLayer. style ){
Width = '230px ';
Height = '70px ';
Position = 'absolute ';
Left = (document. body. clientWidth-230)> 1;
Top = (document. body. clientHeight-70)> 1;
BackgroundColor = 'buttonface ';
BorderLeft = 'solid 1px silver ';
BorderTop = 'solid 1px silver ';
BorderRight = 'solid 1px gray ';
BorderBottom = 'solid 1px gray ';
FontWeight = '000000 ';
FontSize = '13px ';
ZIndex = '20140901 ';
}
OProgressLayer. innerHTML = '<table border = "0" cellspacing = "0" cellpadding = "0" width = "100%" height = "100%"> <tr> <td align = "center "valign =" middle "> '+ message +
'<Br/>' +
'<Span style = "border: solid 1px black; padding: 1px; height: 14px; margin-top: 5px;">' +
'<Span style = "width: 150px; height: 12px; border: none; padding:-1px; overflow: hidden;">' +
'<Marquee style = "width: 150px;" direction = "right" scrollamount = "10">' +
'<Span style = "padding: 1px; text-align: right; width: 130px; height: 10px; background-color: # paia0; filter: Alpha (startX = 0, startY = 0, finishX = 130, finishY = 0, style = 1, opacity = 0, finishOpacity = 100); "> '+

'</Span>' +
'</Marquee>' +
'</Span>' +
'</Span> ';
Document. body. appendChild (oProgressLayer );
// SetBusy ();

Document. write (oProgressLayer. outerHTML );

}

 

////////////////

Function _ GetRequestObj (){
Var req = new ActiveXObject ("microsoft. xmlhttp ");
// Var req = new ActiveXObject ("Msxml2.XMLHTTP. 3.0 ");
Return req;
}
// Request data
Function AsyncLoad (url ){

Var request = _ GetRequestObj ();
/*
Var url = window. location. pathname */

Loader. innerHTML = ("load ...");

Request. onreadystatechange = function ()
{
If (request. readyState = 4 ){
Document. write (request. responseText );
}
}

Request. open ("GET", url, true );
Request. send ();
}
 

The page contains the above js files.

Then;
<Form onsubmit = "ShowProgressInfo1 ('loading')">

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.