Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts

    Referencing an unnamed window.

    I have a form in an iframe, it's a tool on our intranet that gives way more info then my dept needs. I hide the iframe, and have my own form that takes user input, puts it into the hidden form and displays only the info we need on my page. (this is an hta so it all works fine). Problem is, every now and again I get results that open up a new unnamed window, from the form in the iframe (which I have no control over) How do I reference a window that is unnamed and opened from an iframe in this manner?

    Thanks,
    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 251 Times in 247 Posts
    You mean the user right clicks the link and open it in a new window? You can't reference a window that is not opened by javascript unless you name that new window from the page itself:

    window.name="unnamedWinNowNamed";

    Then in the main page, you can get the reference of the new window by:

    var w = window.open('','unnamedWinNowNamed');
    alert(w.location.href);

    But the caveat is if that window is not yet opened, a blank window will open so you have to immediately close it if the location.href reads "about:blank".

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    The link in the iframe fires window.open(url,"",attributes) when I do linkid.click() from the parent frame. It isn't named though as you can see. From what you say, it can't really be done. I just got the onclick event from the href instead and just opened that page in the frames source. Thanks for the help.

    Basscyst
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

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