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 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Popup Windows for IE7

    Hi, I made a pop up window for my site for my Admin Controls and the pop up javascript window works for every browser but IE7 (Not that I'm surprised)...


    I was wondering if someone here could tell me how to make a fixed pop up window that will work for all of the browsers out there right now.

    Thanks,
    Jon W

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,187
    Thanks
    80
    Thanked 4,560 Times in 4,524 Posts
    What KIND of popup??? YOu mean as in window.open( ) or you mean a simple hidden <DIV> that you pop into view as needed???

    Actually, I've used both with no issues, so I don't know what you are doing that is causing you grief. Show your code, I suppose, if you want us to see what the bug is.

    ************

    ADDED: See your other thread. You have a bug in your code.
    Last edited by Old Pedant; 03-22-2009 at 09:49 PM.

  • #3
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Code:
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    {
    	newwindow=window.open(url,'/controls/chat.php','height=400,width=630','resizable=no,scrolling=no');
    	if (window.focus) {newwindow.focus()}
    
    }
    
    </script>
    Thats the code there. This doesn't work in IE7 at all. Also I can't seem to get the windows whenever they pop up to stay fixed. It just doesn't work. Even though you can clearly see that it says resizable=no.

    Help.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,187
    Thanks
    80
    Thanked 4,560 Times in 4,524 Posts
    As noted in the other thread, the code is just plain wrong.

    It should be:
    Code:
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    {
    	newwindow=window.open(
                url,
                '/controls/chat.php',
                'height=400,width=630,resizable=no,scrolling=no');
    	if (window.focus) {newwindow.focus()}
    
    }
    Remember: Only *3* arguments to window.open.

  • #5
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Okay, I just gave this one a try. Still the same results. It opens on firefox and google chrome but it however still wont open in IE7. Also the window isn't staying fixed.
    Last edited by Jon W; 03-22-2009 at 11:05 PM.

  • #6
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Not to sure what is doing this.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,187
    Thanks
    80
    Thanked 4,560 Times in 4,524 Posts
    ** BINGO **

    I actually tried it on both MSIE 6 and MSIE 7 and guess what...if you turn on JavaScript debugging, you are getting an "Invalid argument" error on the window.open call!

    REASON: Your window name is
    Code:
    /controls/chat.php
    And with MSIE, the window name *MUST* be a valid JavaScript name, because it can be used in later coding *as* a name!

    So change that to
    Code:
    <script type="text/javascript">
    var newwindow;
    function poptastic(url)
    {
    	newwindow=window.open(
                url,
                '_controls_chat_php',
                'height=400,width=630,resizable=no,scrolling=no');
    	if (window.focus) {newwindow.focus()}
    
    }
    (or why not just name it "CHAT"???) and watch it start working.

    And, by the by, the window that pops up is *NOT* resizable and does *NOT* have scrollbars.

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,187
    Thanks
    80
    Thanked 4,560 Times in 4,524 Posts
    But yeah, the window still is resizable in FireFox. Also tried
    resizable=0
    with no difference. Works with MSIE not with FF.

  • #9
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,187
    Thanks
    80
    Thanked 4,560 Times in 4,524 Posts
    Ahhh...once again, it help to RTFM!

    https://developer.mozilla.org/en/DOM/window.open

    I quote from that page:
    resizable
    If this feature is set to yes, the new secondary window will be resizable.
    ...
    Starting with Firefox 3, secondary windows are always resizable
    So...that's one "feature" you can give up on now.

  • #10
    Regular Coder
    Join Date
    Jan 2008
    Posts
    334
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thanks again for the feedback man! What does RTFM stand for though? lol


    Jon W

  • #11
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Jon W View Post
    Thanks again for the feedback man! What does RTFM stand for though? lol

    Jon W
    Read The Fabulous Manual,

    sort of,

    best regards


  •  

    Posting Permissions

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