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

W

w2000

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"


......
 
R

Richard Cornford

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

.w2000..

Richard said:
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?

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.
Ahh, Macromedia javascript (enough said).

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

Thomas 'PointedEars' Lahn

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.
 

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,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top