Results 1 to 6 of 6

Thread: Giving a name to a window

  1. #1
    Join Date
    Sep 2005
    Location
    Connecticut
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Giving a name to a window

    Hi again. I'm not sure whether this would be HTML or not, but does anyone know if you can give a name to a window that isnt a pop-up? If so, how would you do it?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't understand. A window that isn't a popup? An existing window? Or do you mean a window created by target=? If the latter, target="windowname" will create a window called windowname.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Sep 2005
    Location
    Connecticut
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, I meant an existing window that the user opened themselves without a link, when they type the address in the URL bar.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    <script type="text/javascript">
    this.name='windowName'
    </script>

    However, this will name the window, not the page. Once this script has run, for as long as the window stays open it will have 'windowName' for its name unless changed by another script. This can have some uses though, I would think, like passing a variable to other pages that will appear in the same window. It cannot be used to override the prohibition against closing windows, not created by javascript, using javascript. It will also interact (replace/be replaced) with other variables called name, like in forms.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2005
    Location
    Connecticut
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What i needed to do was create a way for links in a javascript pop-up window to make another page appear in a seperate window that was already created. (i know it sounds kinda confusing).
    Anyway, thanks for the help.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In that case, name the other window when you create it, or use the method from my last post to name it at some point before the pop-up that you want to be able to access it by name is created.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •