By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Controlling specific popup window

P: n/a
Hi,
I have a main HTML page who opens diferrent popup windows, each of them with
a specific ID.

Now my needs are to refresh the content of only one of them at onClick event
on main page.

The function used to open popup is:

function showImagePopUp(pURL, idFoto){
var id = 'popup_'+idFoto;
var popW = 830, popH = 700;
var winl = (screen.width-popW)/2;
var wint = (screen.height-popH)/2;
popup_win = window.open(pURL, id,
'status=no,resizable=1,scrollbars=1,width=' + popW + ',height=' + popH +
',top=' + wint + ',left=' + winl);
}

My question is: how can i get the correct window object to apply the reload
method?

Greetings and thanks for any suggestion.
-f
Jan 16 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Math wrote:
I have a main HTML page who opens diferrent popup windows, each of them with
a specific ID.
Windows do not have an ID, they have a name.
Now my needs are to refresh the content of only one of them at onClick event
on main page.
[...]
My question is: how can i get the correct window object to apply the reload
method?
You don't really need Location::reload(), usually proper cache control
headers would suffice: Just pass the same name you used before with
window.open() and a different or the same URI. However, window.open()
will then return the object reference which you can use to call any method
of the respective Window object or of the objects its properties refer to.

You can also keep the retrieved object reference globally available;
however, you would then need to test whether the reference is still valid
before using it as the reference base for a method call.

http://jibbering.com/faq/#FAQ4_10
http://jibbering.com/faq/#FAQ4_42

<FAQENTRY>
http://developer.mozilla.org/en/docs/DOM:window.open
http://developer.mozilla.org/en/docs...indow.open#FAQ
</FAQENTRY>
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Jan 16 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.