p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   Window refresh and window pop up in Java Script (http://p2p.wrox.com/showthread.php?t=1923)

Aleksandra July 21st, 2003 04:49 PM

Window refresh and window pop up in Java Script

I am new to Java Script.
1.Is there any window.refresh() function which will let me refresh a certain page?

2.Can you please tell me how to pop up a window using JScript by triggering with a variable (instead of using onClick, onLoad,...)?

Any help is appreciated


lillu July 22nd, 2003 07:11 AM

Hi Aleksandra,

1. Yes, there is. Take a look at this page: http://grizzlyweb.com/webmaster/javascripts/refresh.asp

2. Place this between <head> ... </head> tags.

<script language="javascript">
function popupWindow()
newWin=window.open('some_page.htm','newWin','toolb ar=no,location=no,directories=no,status=no,menubar =no,scrollbars=no,resizable=no,width=300,height=20 0,top=100,left=100')

Adjust the properties to your needs.

  Place this between <body> ... </body> tags.

(Call the window from some element on your page: a link, image, etc.)

<a href="javascript:popupWindow()">Popup Window</a>



The Purple Couch

chwagssd March 2nd, 2007 06:47 PM

Don't user window.location.reload(), it doesn't return a value until after the reload completes, which is a problem if say for example you are doing the following, as i did


afterSave = function(){
}/*if I had used opener.location.reload(); then the popup window running the function would not run the 3rd command close() until after the opener was completely reloaded*/

All times are GMT -4. The time now is 06:41 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.