SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict limepickle's Avatar
    Join Date
    Jan 2006
    Location
    Aldridge UK
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript popup window questions..

    Hello, I'm hoping someone can offer some help on this one. I'm really struggling with the syntax for the following:

    I want to have a dropdown list of countries that opens a popup window when selected. This window contains a map for the relevant country, using a passed country url parameter.

    The popup is then 'repopulated' with another url when the dropdown has an onChange, using
    Code JavaScript:
    this.options[this.selectedIndex].value
    .

    I imagine I'd trigger the popup using an onclick event on the <select> tag, and then in subsequent clicks it would check that a child window exists, and if so it wouldn't retrigger.

    I can do the bit where it re-populates the child window I think, but I don't know how to:

    A: check for the existence of the child window
    B: refer to the child window to chage its url.

    Any help would be a lifesaver indeed.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,820
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Put the same value in the second parameter of the window.open and of the window already exists then the page will load in that window instead of in a new window. Any value that doesn't start with an underscore will do. The ones that start with an underscore are reserved for special meanings such as _blank to always open a new window.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Addict limepickle's Avatar
    Join Date
    Jan 2006
    Location
    Aldridge UK
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks felgall,

    have a good day


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
  •