popups don't work with IE6

D

danielmcbrearty

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
 
L

Lee

(e-mail address removed) said:
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',
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.

No periods in window names.
 
V

VK

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');
 
R

Randy Webb

VK said the following on 1/16/2006 4:15 PM:
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.
 
R

Richard Cornford

VK said:
(e-mail address removed) wrote:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top