Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

Use lightbox to tell user page is loading

Hey,

I have a form which when submitted uses a $.get(script, {}, gotoSite) query, which runs a python script and then redirects to the required page. The script takes approximately 30 seconds to run, so during this time i want to use a lightbox to tell the user that the page is loading.

 I had a look at jquery's lighbox, but couldnt see how i could implement it.
At the moment i load a 'laoding' html page at the same time as the $.get() function, then i close that page when the gotoSite() function is reached.

View bellow code:
<script>
    url = "cgi-bin/script.py?";
    function submitUsingGet()
    {
        ....
        $.get(url, {}, gotoSite);
        createWindow();   // This is where i load the html 'loading page'
    }
 
    function gotoSite()
    {
        window.location = "page.htm";
        closeBar();   // This is where i close the 'loading page'
    }
</script>

Open in new window

0
bman87
Asked:
bman87
1 Solution
 
selvolCommented:
Have yo tried this method here.
 
You can replace the <iframe............
with your page....
 
http://www.weberdev.com/get_example-4431.html
Selvol

<style>
 
body {
  margin: 0; 
  padding: 0;
}
 
A {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #4D6E8D;
  text-decoration: none;
}
 
INPUT {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
  border: 1px solid #E0DEDE;
  background: #FFFFFF;
}
 
.dropdown {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
  border: 1px solid #E0DEDE;
  background: #FFFFFF;
}
 
TEXTAREA {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
  border: 1px solid #E0DEDE;
}
 
A:HOVER {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
  text-decoration: none;
}
 
.text {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #999999;
}
 
.small_text {
  font-family: Verdana, Arial;
  font-size: 9px;
  color: #8B92A7;
}
 
A.enlarge {
  font-family: Courier New, Courier, Verdana, Arial;
  font-size: 11px;
  color: #4D6E8D;
}
 
A.enlarge:HOVER {
  font-family: Courier New, Courier, Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
}
 
.comment_head {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
  font-weight: bold;
}
 
.ok {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #008811;
}
 
.err {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #FF0000;
}
 
.head {
  font-family: Verdana, Arial;
  font-size: 26px;
  color: #999999;
}
 
.admin_head {
  font-family: Verdana, Arial;
  font-size: 30px;
  color: #999999;
}
 
.blog_head {
  font-family: Verdana, Arial;
  font-size: 20px;
  color: #949BA9;
}
 
.blog_head A {
  font-family: Verdana, Arial;
  font-size: 20px;
  color: #949BA9;
}
 
.blog_head A:HOVER {
  font-family: Verdana, Arial;
  font-size: 20px;
  color: #DDDDDD;
}
 
.subHead {
  font-family: Verdana, Arial;
  font-size: 18px;
  color: #8B92A7;
}
 
.menu {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #8B92A7;
  border-left: 1px solid #E0DEDE;
  border-right: 1px solid #E0DEDE;
  border-top: 1px solid #E0DEDE;
  border-bottom: 1px dashed #E0DEDE;
  cursor: pointer;
}
 
.sub_menu {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #999999;
  border-left: 1px solid #E0DEDE;
  border-right: 1px solid #E0DEDE;
  border-bottom: 1px solid #E0DEDE;
  cursor: pointer;
}
 
.admin_menu {
  font-family: Verdana, Arial;
  font-size: 11px;
  color: #999999;
  border-top: 1px solid #E0DEDE;
  border-left: 1px solid #E0DEDE;
  border-right: 1px solid #E0DEDE;
  border-bottom: 1px solid #E0DEDE;
  cursor: pointer;
}
 
.selected_menu {
  background: #F3F3F3
}
 
.cptext {
  font-family: Verdana, Arial;
  font-size: 10px;
  color: #888888;
}
 
#fullPage {
	position: absolute;
	z-index: 100;
	background-color: #fff;
	filter:alpha(opacity=80);
	-moz-opacity: 0.8;
	opacity: 0.8;
	top: 0%;
	left: 0;
	height: 100%;
	width: 100%;
	text-align: center;
	line-height: 10;	
}
 
#siteLoader {
	position: absolute;
	z-index: 100;
	background-color: #000;
	filter:alpha(opacity=80);
	-moz-opacity: 0.8;
	opacity: 0.8;
	top: 40%;
	left: 0;
	height: 43%;
	width: 100%;
	text-align: center;
	line-height: 0;	
}
 
#loadImg {
	position: absolute;
	text-align: center;
	background-color: #fff;
	width: 100%;
	z-index: 100;
	top: 10%;
	left: 0;
	line-height: 0;	
}
 
#loadText {
  position: relative;
  font-family: Verdana, Arial;
  font-size: 20px;
  top: 87%;
  height: 25px;
  color: #fff;	
  text-align: center;  
	vertical-align: bottom;
}
 
#siteDetailLoader {
  position: relative;
  font-family: Verdana, Arial;
  font-size: 10px;
  color: #fff;	
	text-align: right;  
  top: 5%;	
  right: 10px;
}
</style>
<html>
  <head>
    <title>Load</title>
    <link rel="stylesheet" href="style.css" type="text/css" media="screen">
  </head>
  <body topmargin="0" bottommargin="5" onLoad="document.getElementById('siteLoader').style.display = 'none';">
      <div id='siteLoader'>
        <div id='siteDetailLoader'>
        </div>
        <div id='loadImg'>
        <img src='YOUR IMAGE.gif' border='0'>
        </div>
        <div id='loadText'>
  Loading
        </div>
      </div>
      YOUR PAGE HERE
    </body>
 
 </html>

Open in new window

0
 
CWS (haripriya)Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now