SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question window.open error

    I am currently using IE 5.5 and 6.0. I have the following string to open a new window and pass vars to the new page. I am getting an error on page warning in the bottom left corner status bar. Here is the code:

    <a href="javascript:newWindow=window.open('../projects/get-breakdown.php?var=var&var1=<?echo $var1; ?>&var2=<?echo $var2; ?> ,'ContactDetail','width=800,height=600,left=30,top=30,scrollbars=yes,resizable=yes,menubar=yes,statu<BR>s'); "><?echo $var4;?></a>


    Any suggestion appreciated.

    Scott
    Last edited by scoorton; Oct 23, 2003 at 09:52.

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a href="javascript:priceWindow=window.open('../projects/get-breakdown.php?var=var&var1=<?echo $var1; ?>&var2=<?echo $var2; ?>','ContactDetail','width=800,height=600,left=30,top=30,scrollbars=yes,resizable=yes,menubar=yes,status');"><?echo $var4;?></a>
                                                                                              there was a missing single quote here^

  3. #3
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am opening this window.open from a subwindow, how do I open a new browser window from a subwindow.

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you have should work (it is completely js-dependant tho).

    You can open a child window from any window - even other child windows.

  5. #5
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Why not try
    Code:
    <a href="javascript:window.open('url');">New Window</a>
    Use single quotes in the window.open if you are using double quotes after href. Also it would be better if you make a function like
    Code:
    function myWin()
    {
    var w = window.open("url");
    }
    & then call it like
    Code:
    <a href="javascript:myWin()">New Window</a>
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


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
  •