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>
Status Bar (Javascript) Text Disabled See that link above. Firefox doesn't allow the status bar text to be changed unless you enable the setting. Its disabled by default.
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.
I did try my program with status turn on following the instructions from the link. But it still doesn't work. I wonder why.
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.
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?
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.
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?