Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

popups don't work with IE6

0 views
Skip to first unread message

danielm...@gmail.com

unread,
Jan 16, 2006, 3:45:18 PM1/16/06
to
Hi

Can anyone tell me why the following javascript code doesn't work with
IE6? (It's fine with Firefox of course ...)

(in teh document head)
<script type="text/javascript" language="javascript1.2">
<!--
function smallpopup(purl)
{
var newwindow=window.open(purl,'engoi.com',
'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
if (window.focus) {newwindow.focus();}
return false;
}
function largepopup(purl)
{
var newwindow=window.open(purl,'engoi.com',
'left=500,top=100,width=550,height=500,scrollbars=1,toolbar=1');
if (window.focus) {newwindow.focus();}
return false;
}
-->
</script>

.
.
.

(in the document body)

<a href="../somedir/myscript.cgi?lang=en"
onClick="return smallpopup('../somedir/myscript.cgi?lang=en')">do it!
</a>

The doc loads with no errors, but when the link is clicked, IE6
complains that the arg to the function is improper, and loads in a
normal window.

If anyone can help, that's great!

Thanks

Daniel

VK

unread,
Jan 16, 2006, 4:15:51 PM1/16/06
to

danielm...@gmail.com wrote:
> Hi
>
> Can anyone tell me why the following javascript code doesn't work with
> IE6? (It's fine with Firefox of course ...)
>
> (in teh document head)
> <script type="text/javascript" language="javascript1.2">
> <!--
> function smallpopup(purl)
> {
> var newwindow=window.open(purl,'engoi.com',
> 'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
> if (window.focus) {newwindow.focus();}
> return false;
> }
> function largepopup(purl)
> {
> var newwindow=window.open(purl,'engoi.com',
> 'left=500,top=100,width=550,height=500,scrollbars=1,toolbar=1');
> if (window.focus) {newwindow.focus();}
> return false;
> }
> -->
> </script>

I don't believe you it works in Firefox... But off topic, anyway.

1) Assigned window name is the 2nd argument of window.open(), not the
1st one.
2) Probably a string jam grace to Google Groups but just in case: the
entire method call must be one line.

This call works: (if it's broken on two or more lines it's because of
your news reader: it is *one* line)

var
newwindow=window.open('http://www.google.com','www','left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');

Message has been deleted

Randy Webb

unread,
Jan 16, 2006, 5:10:06 PM1/16/06
to
VK said the following on 1/16/2006 4:15 PM:

> danielm...@gmail.com wrote:
>
>>Hi
>>
>>Can anyone tell me why the following javascript code doesn't work with
>>IE6? (It's fine with Firefox of course ...)
>>
>>(in teh document head)
>><script type="text/javascript" language="javascript1.2">
>><!--
>>function smallpopup(purl)
>>{
>> var newwindow=window.open(purl,'engoi.com',
>> 'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
>> if (window.focus) {newwindow.focus();}
>> return false;
>>}
>>function largepopup(purl)
>>{
>> var newwindow=window.open(purl,'engoi.com',
>> 'left=500,top=100,width=550,height=500,scrollbars=1,toolbar=1');
>> if (window.focus) {newwindow.focus();}
>> return false;
>>}
>>-->
>></script>
>
>
> I don't believe you it works in Firefox... But off topic, anyway.

It would as this question/problem was brought up a week or so ago.

> 1) Assigned window name is the 2nd argument of window.open(), not the
> 1st one.

And nothing to the contrary in the code. The problem is the period in
the window name. Firefox happily accepts it but IE doesn't.

> 2) Probably a string jam grace to Google Groups but just in case: the
> entire method call must be one line.
>
> This call works: (if it's broken on two or more lines it's because of
> your news reader: it is *one* line)
>
> var
> newwindow=window.open('http://www.google.com','www','left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');

Because your window name does not have a period in it. Change your
window name from 'www' to 'w.w.w' and your code will break in IE but
work fine in Firefox.


--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

Richard Cornford

unread,
Jan 16, 2006, 5:35:45 PM1/16/06
to
VK wrote:
> danielm...@gmail.com wrote:
<snip>

>> var newwindow=window.open(purl,'engoi.com',
>> 'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
<snip>

> 1) Assigned window name is the 2nd argument of window.open(),
> not the 1st one.

Too drunk to even count?

> 2) Probably a string jam grace to Google Groups but just in
> case: the entire method call must be one line.

<snip>

What is the point in posting such an obvious lie? Surly it can only
serve to make it obvious that you are a fool of staggering proportion (a
redundant action given your posting record)?

Richard.


danielm...@gmail.com

unread,
Jan 17, 2006, 1:36:12 AM1/17/06
to
Thanks very much for the helpful replies ... the rest I'll ignore!
D

0 new messages