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

Why this custom open.window( ) function works on some PCs only

P: n/a
Greeting all,

I am studying Javascript to custom my yahoo estore,
I need to open a custom sized window in a new browser ,
I tried the following script on 3 different PCs running XP
pro. IE 6, it worked on one and did not work on the other two.
Please need your help.

Thanks
Luka

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features)
{
window.open(theURL,winName,features);
}
//-->
</script>
<body>
<a href="http://mysite ; target = "_blank";

onClick="MM_openBrWindow('http://mysite','winName',

'resizable = yes,toolbar=no, directories=no, location=no,

status=no, menubar=no, resizable=no, scrollbars=no,

width=200,height=200, screenX=100, screenY=75');

return false"
......

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
w2***@insight.rr.com wrote:
Greeting all,

I am studying Javascript to custom my yahoo estore,
I need to open a custom sized window in a new browser ,
Late last year I read a report that the use of pop-up blockers had
increased by 1400% between 2003 and 2004. If you are in business do you
really _need_ to be turning away a growing proportion of potential
customers? This is probably an instance of trying to solve the wrong
problem, and costing yourself revenue in the process.
I tried the following script on 3 different PCs running
XP pro. IE 6,
Since I read the report mentioned above XP SP2 was released, with its
own pop-up blocker (active by default).
it worked on one and did not work on the other two.
Please need your help.

Thanks
Luka

<script language="JavaScript" type="text/JavaScript">
The type attribute alone is sufficient in an opening SCRIPT tag. The
language attribute is deprecated in HTML 4.01.
<!--
Using what may be taken as HTML comment to "hide" scripts from older
browsers is no longer necessary.
function MM_openBrWindow(theURL,winName,features)
Ahh, Macromedia javascript (enough said).
{
window.open(theURL,winName,features);
}
//-->
</script>
<body>
<a href="http://mysite ; target = "_blank";
onClick="MM_openBrWindow('http://mysite','winName',
'resizable = yes,toolbar=no, directories=no, location=no,

<snip>

The 'feature' list provided as the third argument to the window.open
function is specified as a comma separated list not a comma-space
separated list. And depriving the use of the ability to resize and/or
scroll is based on the erroneous assumption that it is possible to
precisely control the size and layout of the content of the window. That
cannot be done, and in a commercial context it is not a good idea to
render site content inaccessible because that will also result in
needlessly truing away business.

Richard.
Jul 23 '05 #2

P: n/a
Richard Cornford wrote:
w2***@insight.rr.com wrote:
Greeting all,

I am studying Javascript to custom my yahoo estore,
I need to open a custom sized window in a new browser ,
Late last year I read a report that the use of pop-up blockers had
increased by 1400% between 2003 and 2004. If you are in business do

you really _need_ to be turning away a growing proportion of potential
customers? This is probably an instance of trying to solve the wrong
problem, and costing yourself revenue in the process.

Very good point Richard , however, is there any other way to add a
currency converter calculator to my web page, I was intending to link
to a calculator in a pop up window. I am still in the start of the
learning curve, why some site for example CNN (I looked into their
code)
have more or less the same function yet their pop ups will open
precisely
as expected without triggering the browser blocker?

<snip>
<script language="JavaScript" type="text/JavaScript">


The type attribute alone is sufficient in an opening SCRIPT tag. The
language attribute is deprecated in HTML 4.01.
<!--


Using what may be taken as HTML comment to "hide" scripts from older
browsers is no longer necessary.


Thanks for the tips.
function MM_openBrWindow(theURL,winName,features)


Ahh, Macromedia javascript (enough said).
{
window.open(theURL,winName,features);
}
//-->
</script> <body> <a href="http://mysite ; target = "_blank";
onClick="MM_openBrWindow('http://mysite','winName',
'resizable = yes,toolbar=no, directories=no, location=no,

<snip>

The 'feature' list provided as the third argument to the window.open
function is specified as a comma separated list not a comma-space
separated list.


I had the impression the Javascript interpreter ignors white space.
And depriving the use of the ability to resize and/or
scroll is based on the erroneous assumption that it is possible to
precisely control the size and layout of the content of the window. That cannot be done, and in a commercial context it is not a good idea to
render site content inaccessible because that will also result in
needlessly truing away business.

Richard.


Another good point, I was planning to publish the store then optomize
through trial and error, this will save me some pitfalls.

Thanks for all the help.

Luka

Jul 23 '05 #3

P: n/a
..w2000..@insight.rr.com wrote:
Richard Cornford wrote:
w2***@insight.rr.com wrote:
> <a href="http://mysite ; target = "_blank";
> onClick="MM_openBrWindow('http://mysite','winName',
> 'resizable = yes,toolbar=no, directories=no, location=no,

<snip>

The 'feature' list provided as the third argument to the window.open
function is specified as a comma separated list not a comma-space
separated list.


I had the impression the Javascript interpreter ignors white space.


That is true for space characters outside of literals (due to automatic
semicolon insertion it does not apply generally to white space which
includes newline characters). The white space occurs within a string
literal here and so is not ignored by the J(ava)Script engine (consider
a sentence/paragraph lacking all spaces/line breaks -- you don't really
want that).

However, it is not the J(ava)Script engine to parse that string but another
component of the UA; `window' refers to a host object, not an JS/ECMAScript
object (although described so prior to JavaScript 1.4 since Netscape UAs
were the only one to implement true JavaScript), and window.open() is now
(as of JavaScript 1.5, Gecko DOM and IE DOM) specified as a proprietary DOM
feature, not a language feature. But it always had the syntax Richard
described.
PointedEars

P.S.
Please trim your quotes.
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.