vinpkl
August 5, 2016, 10:41am
1
hi
on submit of form
i am redirecting user to another page
but before redirecting it shows a white screen for 1 second
can i show a message like “please wait its redirecting or its loading” on that white screen.
<script type="text/javascript">
window.location='<?php echo $action; ?>';
</script>
vineet
Are you saying the PHP script you’re calling when the form gets submitted is responding with a page that again redirects the user with JS? This seems a bit odd to me. A JS redirect alone should wait until the destination page got loaded anyway. See here for an example: http://m3g4p0p.bplaced.net/redirect.html
vinpkl
August 5, 2016, 11:41am
4
hi m3g4p0p
while click on redirect
it shows message as redirect
then i see a full big black blank screen
then sitepoint page is loaded.
This is what i was talking.
i want to show a message on the big black screen that i see before sitepoing page load.
i dont want to show message before redirecting like this page is doing.
rather i want to show a message on big blank screen which is seen before sitepoint page loads
vineet
vinpkl
August 5, 2016, 11:46am
5
just like this below screenshot
i would like to show redirect message on both white and black screen if possible.
Hm, then it’s maybe a browser specific issue… I’m using chromium and when I click redirect, it loads a bit (while still staying on the original page) and then instantly takes me to the destination page.
Anyway, as soon as you’re leaving the page it doesn’t have any control over the browser any more – this would be a huge security risk, obviously. So no, you can’t display a message after the redirect took action.
vinpkl
August 5, 2016, 2:10pm
7
hi m3g4p0p
i am trying to show the “#loadpage ” div if the “Content ” div is empty
and want to hide “#loadpage ” div if “Content ” div is not empty
if the Content div is not having empty spaces then it gets hide.
if “Content ” div has empty spaces then “loadpage” page doesnt gets hide
<div id="content"></div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
#content{background-color:#FF0000; display:block;height:500px}
</style>
</head>
<body>
<div id="content"> </div>
<div id="loadpage" style="position:absolute; left:0px; top:0px; height:100%; width:100%; background-color:#CCCCCC">
<p align="center" style="font-size: 30px; vertical-align:middle; line-height:500px">Loading ... </p>
</div>
<script src="jquery-1.11.2.min.js"></script>
<script type="text/javascript">
if($("#content").text() == '')
{
$("#loadpage").show();
}
if($("#content").text() != '')
{
$("#loadpage").hide();
}
</script>
</body>
</html>
what is the solution ??
vineet
I’m not quite sure what the problem is… maybe try
if (!$('#content').text().trim()) {
$('#loadpage').show();
}
// etc.
to take whitespace into account.
system
Closed
November 4, 2016, 10:04pm
10
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.