Debt Consolidation - Wordpress Themes - Find jobs - Myspace Layouts - Find jobs

PDA

View Full Version : short code, window.status doesn't work??


aayybb
Oct 30th 2008, 6:45 am
Hi,

I have the following short code and the window.status line doesn't work for me. It doesn't seem to be == "Done". The window.open and window.location work and it shows a image for me. Can anybody tell me what I did wrong on the window.status?


<!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=utf-8" />
<title>search animation</title>
<script type="text/javascript">


function open_win()
{
myWindow=window.open('','MyName','width=120,height=100');

myWindow.window.location="http://abc???.com//???/search_animate.html";

myWindow.focus();
var dd ="Done";
if (myWindow.opener.window.status == dd)
myWindow.opener.document.write("done")
else
myWindow.opener.document.write("This is the parent window")
}
</script>
</head>

<body>
<form>
<input type="button" value="Start count!" onClick="open_win()">

</form>
</body>
</html>

profs77
Oct 30th 2008, 9:31 am
Status Bar (Javascript) Text Disabled (http://www.foxyfirefox.com/tweaks/status-bar-javascript-text-disabled.html)


See that link above. Firefox doesn't allow the status bar text to be changed unless you enable the setting. Its disabled by default.

aayybb
Oct 30th 2008, 12:44 pm
Thank you very much.
In that case, then I can't use this function since not everybody turns that status on. Too bad. I was hoping to use it.
Thanks again.

aayybb
Oct 30th 2008, 7:52 pm
I did try my program with status turn on following the instructions from the link. But it still doesn't work. I wonder why.

Logic Ali
Nov 1st 2008, 5:24 pm
If you write to window.status then you should be able to read back the value.
The text that the browser writes to the status bar is not stored in window.status.
For your purposes this is academic since the document in the popup will not have loaded at the point that you try to read the status bar.

aayybb
Nov 1st 2008, 8:35 pm
Thank you very much for the explanation.
My next question then. How do I stop thing running in the popup based on what happened in the parent window? Say I have something running in the parent window. I have an animated gif running in the popup. When the thing is done in the parent window I want the popup closed.

How do accomplish this?

Logic Ali
Nov 2nd 2008, 5:59 pm
When the thing is done in the parent window I want the popup closed.myWindow.close();

aayybb
Nov 2nd 2008, 7:30 pm
I am sorry. I didn't explain my question well.

What I want to know is how to figure out the process is done in the parent window. I thought about checking status at first but that is not the right route.

Logic Ali
Nov 2nd 2008, 7:46 pm
I am sorry. I didn't explain my question well.

What I want to know is how to figure out the process is done in the parent window. I thought about checking status at first but that is not the right route.What is the process?

aayybb
Nov 3rd 2008, 1:11 pm
I want to make the example simple here. Say the parent window is running a counting machine. It start counting from 1 till 1,000,000,000 then stops. Without checking the counter variable, is there any other way to know it is done counting?
Or the parent window is searching something in the database. How can I tell it is done searching the database?