HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 20th, 2000, 09:01 AM
djbeddows djbeddows is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Grantham,Lincs, UK
Posts: 7 djbeddows User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old June 21st, 2000, 07:01 AM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
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]


Reply With Quote
  #3  
Old June 21st, 2000, 07:56 AM
djbeddows djbeddows is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Grantham,Lincs, UK
Posts: 7 djbeddows User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old June 24th, 2000, 12:18 AM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
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]


Reply With Quote
  #5  
Old June 24th, 2000, 12:19 AM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
Damn smiley faces!

The little blue 'sad' faces are actually colons (.

Russ

Reply With Quote
  #6  
Old June 24th, 2000, 09:28 PM
Spookster Spookster is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Posts: 84 Spookster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > reloading windows


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway