SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Child Window

  1. #1
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Child Window

    Hiya,

    Using JavaScript, how do I open a Child Window, upon clicking a link in the Parent Window?
    Is it possible to have a Refresh button on the parent window, that refreshes the parent window onclick?

    TicTac

  2. #2
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Child Window

    OK, I have finally come up with the following code, but for some reason the child window won't refresh upon clicking the reload button. Why is this?

    Code:
    <script>
    var w=null;// make global
    </script>
    <form>
    <input type="button"
    onClick="w=window.open('http://www.google.co.uk','newwin','width=300,height=400,resizable')"
    value="open">
    <input type="button"
    onClick="w.location.reload()"
    value="reload">
    </form>

  3. #3
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TicTac View Post
    OK, I have finally come up with the following code, but for some reason the child window won't refresh upon clicking the reload button. Why is this?

    <input type="button"
    onClick="w.location.reload()"
    value="reload">
    [CODE]
    It's a security violation. You must re-apply the URL.
    Code:
    <input type="button"
    onClick="w.location.href='http://www.google.co.uk';w.focus()"
    value="reload">
    Tab-indentation is a crime against humanity.


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
  •