By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

popups don't work with IE6

P: n/a
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

Jan 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
VK

da*************@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');

Jan 16 '06 #2

P: n/a
VK said the following on 1/16/2006 4:15 PM:
da*************@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.

Jan 16 '06 #3

P: n/a
VK wrote:
da*************@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.
Jan 16 '06 #4

P: n/a
Thanks very much for the helpful replies ... the rest I'll ignore!
D

Jan 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.