|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi All,
I am looking for a soloution for my reloading problem. If anyone can help please read on. I open a window by calling this: function popupMainWindow(fileName) { //windowVar = window.open("URL", "windowName" [,"windowFeatures"]) window.open(fileName, "Diary", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } On the page it loads there is a link which loads another window like so: function popupEventWindow(fileName) { window.open(fileName, 'Event', "width=450, height=400, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } All the above works fine. While I am in the second window I submit some data to itself and then if its sucessful I pop up a message and close the window. I want to then reload the first window (Diary). My Javascript at the top of the second window which is called on sucess of the submission is: function eventsaved() { alert ('Your Event Has Been Saved'); } function closeWindow() { window.close(); } The above works fine. I then added a call to this reload function, it should reload the other window, but it does not: function reloadOffice() { office.location.reload(true); } If anyone can help it would be greatly appreiciated. Duncan Beddows |
|
#2
|
|||
|
|||
|
I'm not certain where your function:
function reloadOffice() { office.location.reload(true); } is located. If it is in the second pop-up, then you must give it time to run prior to closing the second pop-up. Perhaps some sort of timer before you close the popup. I also assume 'office' is the window name of the popup that you have titled 'Diary'? Is this true? I ask because I don't see anyplace in your script where you define the name of the popup window titled 'Diary'. (I assume you know window name and window title are two different things.) The function should work as long as the window still exists. So from what you have stated, the only thing I can come up with is you have not properly named the popup window. Does this help? Let me know. Russ <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by djbeddows: Hi All, I am looking for a soloution for my reloading problem. If anyone can help please read on. I open a window by calling this: function popupMainWindow(fileName) { //windowVar = window.open("URL", "windowName" [,"windowFeatures"]) window.open(fileName, "Diary", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } On the page it loads there is a link which loads another window like so: function popupEventWindow(fileName) { window.open(fileName, 'Event', "width=450, height=400, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } All the above works fine. While I am in the second window I submit some data to itself and then if its sucessful I pop up a message and close the window. I want to then reload the first window (Diary). My Javascript at the top of the second window which is called on sucess of the submission is: function eventsaved() { alert ('Your Event Has Been Saved'); } function closeWindow() { window.close(); } The above works fine. I then added a call to this reload function, it should reload the other window, but it does not: function reloadOffice() { office.location.reload(true); } If anyone can help it would be greatly appreiciated. Duncan Beddows[/quote] |
|
#3
|
|||
|
|||
|
I must admit I don't know the difference between name and title unless you are refering to <title> I do. All I did to name the window was give it a name on opening it.
function popupMainWindow(fileName) { window.open(fileName, "office", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } Is this all I need to do to name the windows? when opening multiple popups do they all know of the existance of the other windows?? Or is the message to reload a window just sent to you computer? Many Thanks Duncan |
|
#4
|
|||
|
|||
|
Take the expression:
win1=window.open('myfile.htm','mytitle',details) This line of code opens a window with a name of win1 and a title (in the title bar) of mytitle. You cannot refer to the window by the title. Change your code to: function popupMainWindow(fileName) {myname = window.open(fileName, "office", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } Now you can refer to this popup by the name 'myname'. For example, if you want to check to see if the window is open, and if it isn't, open it, if it is, give it focus, you could write the expression: <a href="#" onclick="javascript win1)?(win1.focus()) win1 = window.open(....));">CLICKME</a>The above could be placed within any appropriate HTML tag. To place it withing a script: if(win1) {win1.focus();} else {win1 = window.open(...);} Hope this helps Russ <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by djbeddows: I must admit I don't know the difference between name and title unless you are refering to <title> I do. All I did to name the window was give it a name on opening it. function popupMainWindow(fileName) { window.open(fileName, "office", "width=750, height=550, status=no, toolbar=no, menubar=no, location=no, scrollbars=yes"); } Is this all I need to do to name the windows? when opening multiple popups do they all know of the existance of the other windows?? Or is the message to reload a window just sent to you computer? Many Thanks Duncan [/quote] |
|
#5
|
|||
|
|||
|
Damn smiley faces!
The little blue 'sad' faces are actually colons ( .Russ |
|
#6
|
|||
|
|||
|
Actually thats completely backwards.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR> Take the expression: win1=window.open('myfile.htm','mytitle',details) This line of code opens a window with a name of win1 and a title (in the title bar) of mytitle. You cannot refer to the window by the title. [/quote] In this statement: win1=window.open('myfile.htm','mytitle',details) "myTitle" is the name of the window that is created. This is how you would access that window from other windows. "win1" is just a variable that the statement is assigned to. You can access the window using this variable within the script. To access that window from other windows you would use the name. Spookster ------------------ Visit the WSAbstract Help Forum for your Javascript, DHTML, or General Web Design Questions |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > reloading windows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|