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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Opening Window in Javascript

    Hey Guys,

    I feel like a complete idiot posting this, but I clearly am missing something. I'm trying to open a window with the specs below but all it does is open a standard sized window.

    Any help would be greatly appreciated.

    Code:
    <SCRIPT LANGUAGE="javascript">
    function open_window() {
    window.open ('https://domain.com/document.php','newwindow',config='height=418,width=590,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')
    }
    </SCRIPT>
                    
    <p><a onclick="open_window()"><img src="images/image.png" width="142" height="113" /></a></p>

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,297
    Thanks
    23
    Thanked 612 Times in 611 Posts
    Remove
    Code:
    config=
    and it should work. Remember most browsers can change the way a popup happens.

  • #3
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks for the reply. I have used config= as you can see. Should I be using it differently?

    Cheers

  • #4
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, I see what you mean. i'll give that a try.

  • #5
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    Remove
    Code:
    config=
    and it should work. Remember most browsers can change the way a popup happens.
    I tried this and it did not work, I got the same result. Any other ideas?

    Cheers!

  • #6
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,297
    Thanks
    23
    Thanked 612 Times in 611 Posts
    As I said the browser has control. I use firefox with tab mix plus. I have to go in and ALLOW a popup, that's a window open with window.open to do that. In my case I normally have it FORCED to open in a separate tag, in which case all the controls for scroll bars etc. are not listened to. I had to shut this off to allow the window you wanted to open.

    Check your browser settings. What browser are you using?

  • #7
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    As I said the browser has control. I use firefox with tab mix plus. I have to go in and ALLOW a popup, that's a window open with window.open to do that. In my case I normally have it FORCED to open in a separate tag, in which case all the controls for scroll bars etc. are not listened to. I had to shut this off to allow the window you wanted to open.

    Check your browser settings. What browser are you using?
    Tested on IE, Firefox, and Chrome. Same result, just a standard window.

  • #8
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,297
    Thanks
    23
    Thanked 612 Times in 611 Posts
    Tested on IE, Firefox, Chrome, and Opera. All worked after making option changes to allow popups. Here's the code, notice https://domain.com/document.php does not exist so I used one of my own internal pages. Also I didn't have your image and linked to one of mine, but this is the code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>New document</title>
    <meta name="generator" content="TSW phpCoder 2010" />
    <script type="text/javascript">
    function open_window() {
    window.open ('http://localhost/Test/test2.html','newwindow','height=418,width=590,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')
    }
    </script>
    </head>
    <body>
    
    <p><a onclick="open_window()"><img src="../TestPrograms/images/2.png" width="142" height="113" /></a></p>
    
    </body>
    </html>
    To futher the experiment I then used yahoo as the html page and just a button to open the popup with this code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>New document</title>
    <meta name="generator" content="TSW phpCoder 2010" />
    <script type="text/javascript">
    function open_window() {
    window.open ('http://www.yahoo.com/','newwindow','height=418,width=590,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no')
    }
    </script>
    </head>
    <body>
    
    <input type="button" value="Open Popup" onclick="open_window()" />
    
    </body>
    </html>
    Worked in all browsers. Post the code that isn't working for you and I'll look at it.


  •  

    Posting Permissions

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