...

View Full Version : Popup Windows for IE7



Jon W
03-22-2009, 02:01 PM
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

Old Pedant
03-22-2009, 09:44 PM
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.

Jon W
03-22-2009, 09:50 PM
<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. :p

Old Pedant
03-22-2009, 10:16 PM
As noted in the other thread, the code is just plain wrong.

It should be:


<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.

Jon W
03-22-2009, 10:59 PM
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.

Jon W
03-22-2009, 11:03 PM
Not to sure what is doing this.

Old Pedant
03-22-2009, 11:40 PM
** 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


/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


<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.

Old Pedant
03-22-2009, 11:45 PM
But yeah, the window still is resizable in FireFox. Also tried
resizable=0
with no difference. Works with MSIE not with FF.

Old Pedant
03-23-2009, 12:03 AM
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.

Jon W
03-23-2009, 01:39 AM
Thanks again for the feedback man! What does RTFM stand for though? lol


Jon W

oesxyl
03-23-2009, 01:47 AM
Thanks again for the feedback man! What does RTFM stand for though? lol

Jon W
Read The Fabulous Manual, :)

sort of, :)

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum