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

bman87Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.