2
In my following example, I have a button that calls through the window.Place a page that takes some time to load. I am trying to create a javascript code that will load the page before it is called and a "loading" label will appear on the button page and then redirect to the other page
<label id="lbl"></label>
<input type="button" value="demo" id="btn_demo">
<script>
var btn = document.getElementById("btn_demo");
btn.onclick = function() {myFunction()};
function myFunction() {
document.getElementById("lbl").innerHTML = "LOADING!";
if page == "loaded" {
window.location.href="demo_load.htm";
}
//call page
}
See if it can help you http://stackoverflow.com/a/25253988
– Diego Souza