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
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript window.open within Frameset

    I have the following code that works fine within an asp file but failes if the file is within a frameset...

    Code:
    <script language="JavaScript">
    
    <!-- 
    function open_new_window(url) 
    {
    new_window = void window.open(url,'displayWindow',"width=500,height=500,left=10,top=10");
    }
    .
    .
    .
     <td width="17%"><font size="-1"><b>Circuit: <a href="javascript:open_new_window('feederinfo.asp?fdr=<%=(feeder)%>')"  style="text-decoration: none"><%=feeder%></a></b></font></td>
    When using the page within the frameset, the error returned is "Object expected" for the frame document file. Been searching the web for hours with no luck. Any help/suggestions would be appreciated.

  • #2
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try:

    top.window.open instead.
    The problem occurs because you try to call it from within a frame.

    Regards

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,700
    Thanks
    80
    Thanked 4,658 Times in 4,620 Posts
    WHAT???

    Code:
    new_window = void window.open(url,'displayWindow',"width=500,height=500,left=10,top=10");
    (1) What's the void in there for???
    (2) Why do you bother assigning it to the variiable new_window??

    But, yes, you indeed do need to use top.window.open or parent.window.open if you are trying to create a popup.


  •  

    Posting Permissions

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