Archive

Archive for the ‘Javascript’ Category

Add HTML while using window.open function in javascript

February 19, 2011 Leave a comment
<SCRIPT LANGUAGE="JavaScript">
<!-- hide this script from old browsers

// This script opens a new browser window and writes
// HTML to display an image with a title and caption

function show_photo( pFileName, pTitle, pCaption) {

// specify window parameters
  photoWin = window.open( "", "photo",
     "width=600,height=450,status,scrollbars,resizable,
     screenX=20,screenY=40,left=20,top=40");

// wrote content to window
  photoWin.document.write('<html><head><title>' + 
    pTitle + '</title></head>');	
  photoWin.document.write('<BODY BGCOLOR=#000000 TEXT=#FFFFCC
    LINK=#33CCFF VLINK=#FF6666>');
  photoWin.document.write('<center>');
  photoWin.document.write('<font size=+3 
    face="arial,helvetica"><b>' + 
    pCaption + '</b></font><br>');
  photoWin.document.write('<img src="' + 
    pFileName + '"><p>');
  photoWin.document.write('<font face=
    "arial,helvetica">');
  photoWin.document.write( '"' + pTitle + 
    '" photo &copy; Lorrie Lava<br>');
  photoWin.document.write('<a href="mailto:
    lava@pele.bigu.edu">
    lava@pele.bigu.edu</a><br>');
  photoWin.document.write('Volcanic Studies, 
    <a href="http://www.bigu.edu/">
    Big University</a>');
  photoWin.document.write('<p></font>
    </body></html>');
  photoWin.document.close();	
	
// If we are on NetScape, we can bring the window to the front
	if (navigator.appName.substring(0,8) == 
	   "Netscape") photoWin.focus();
}
// done hiding from old browsers -->
</SCRIPT>
Categories: Javascript

Refresh Parent Page from Popup window close button

July 27, 2010 Leave a comment

<script language=”JavaScript”>
<!–
function refreshParent() {
window.opener.location.href = window.opener.location.href;

if (window.opener.progressWindow)
{
window.opener.progressWindow.close()
}
window.close();
}
//–>
</script>

Categories: Javascript

Page Refresh when click on popup window close button

October 20, 2009 Leave a comment

you can use this function to make the parent page refresh.
function closeWindow()
{

window.opener.RefreshPage();
window.close();

}

if you want to fire an event based on the pop up click then u can do so by
window.onunload = unloadPage;

based on that function calling u can refresh ur parent page by the following fuinction
function unloadPage()
{
//window.opener.RefreshPage();
window.opener.document.forms[0].submit();
}

this function will make ur parent page refresh while u click on the close button of the pop up window. Let me know if you have any query regarding this.

 

Regards

Munir

How to Refresh popup window

October 20, 2009 1 comment

you can refresh a popup window by the following block of code

if(!opener.document.forms[0])

window.location.reload();

Follow

Get every new post delivered to your Inbox.