SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question refresh page using JS

    Am not i java script coder but you know sometimes is needed.

    ok i have this code that opens for me a new page

    Code:
    <a href="page.php" target="new" onclick="window.open( this.href, this.target, 'resizable=1,HEIGHT=450,WIDTH=500'); return false;">Click here!</a>';
    its working like a charm however; what i need is when the user close the page
    the original page will refresh is that possible in a simple way?

    thanks in advance
    Never be shy to ask silly Qs
    An answer is always better than none

  2. #2
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i Found the answer thanks anyway

    Code:
    function refresh_parent()
    {
        if (opener.progressWindow) {
            opener.progressWindow.close()
        }
        
        opener.top.location.reload();
        window.close();
    }
    
    
    
    
    //to call it with button
    
    <input type="button" value="Cancel" onClick="refresh_parent();">
    POP UP CODE
    Code:
    <a href="page.php" target="new" onclick="window.open( this.href, this.target, 'resizable=1,HEIGHT=450,WIDTH=500' ); return false;">Click here!</a>
    Never be shy to ask silly Qs
    An answer is always better than none


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •