javascript window

D

dorayme

Hi, appreciate any help on this one:

I was mildly surprised to see how a site of mine behaved in Safari 1.1 (I
know, an older version on a Mac running 10.2, again, not the very latest but
it is what my friend had)

The first thing I noticed was that user-activated pop-up windows appeared
tiny and quite unresizable. On all other browsers I have tested, this has
never happened. Basically I allow the user to see a detail of something
without losing his place by a window popping up with the info. The window
has a certain normally adequate size and so on. The code I have used for
years in the head of the html source is :

<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers


function newWindow(fabrics) {
fabricsWindow = window.open(fabrics, 'fredRain',
'width=600,height=400,resizable=yes')
fabricsWindow.focus()

}


// End hiding script from old browsers -->

</script>

and I use the following type of code in the relevant hyperlink in the body:

<a class="plain"
href="javascript:newWindow('../newSeasonsViewer/wave.html')">
See picture of one</a>

which has always worked well except for this Safari. I would like to know if
it works in the latest Safari on 10.3 but how do I do it? The screen capture
facilities for urls on various browsers do not seem to cater for such a
"user operated" pop up.

dorayme
 
D

DU

dorayme said:
Hi, appreciate any help on this one:

I was mildly surprised to see how a site of mine behaved in Safari 1.1 (I
know, an older version on a Mac running 10.2, again, not the very latest but
it is what my friend had)

The first thing I noticed was that user-activated pop-up windows appeared
tiny and quite unresizable. On all other browsers I have tested, this has
never happened. Basically I allow the user to see a detail of something
without losing his place by a window popping up with the info. The window
has a certain normally adequate size and so on. The code I have used for
years in the head of the html source is :

<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers

The "hiding" from old browsers no longer makes sense really as everyone
uses something much better than NS 3. So said:
function newWindow(fabrics) {
fabricsWindow = window.open(fabrics, 'fredRain',
'width=600,height=400,resizable=yes')
fabricsWindow.focus()

There is no need for the focus() call ... unless the pointer in memory
(fabricsWindow) exists and the window is not closed: then and only then,
the focus() call makes sense as it solves the most frequently
encountered usability problem with requested popup window.

e.g.:

var fabricsWindow = null; // global variable
function newWindow(fabrics) {
if(fabricsWindow == null || fabricsWindow.closed)
{ fabricsWindow = window.open(fabrics, 'fredRain',
'width=600,height=400,resizable=yes');
}
else
{
fabricsWindow.focus();
};
}
}


// End hiding script from old browsers -->

</script>

and I use the following type of code in the relevant hyperlink in the body:

<a class="plain"
href="javascript:newWindow('../newSeasonsViewer/wave.html')">
See picture of one</a>

Javascript links defeats features and settings in tab capable browsers.
Some 8-12% of users turn off javascript: so the link as coded will
prevent them from accessing the wave.html resource.

"Users hate unwarranted pop-up windows. When they want the destination
to appear in a new page, they can use their browser's 'open in new
window' command -- assuming, of course, that **__the link is not a piece
of code that interferes with the browser's standard behavior__**."
Jakob Nielsen, Top Ten Web-Design Mistakes of 2002,
6. JavaScript in Links,
http://www.useit.com/alertbox/20021223.html

DU
 
D

dorayme

From: DU said:
Newsgroups: alt.html
Date: Sun, 26 Dec 2004 20:50:26 -0500
Subject: Re: javascript window


The "hiding" from old browsers no longer makes sense really as everyone


There is no need for the focus() call ... unless the pointer in memory
(fabricsWindow) exists and the window is not closed: then and only then,
the focus() call makes sense as it solves the most frequently
encountered usability problem with requested popup window.

e.g.:

var fabricsWindow = null; // global variable
function newWindow(fabrics) {
if(fabricsWindow == null || fabricsWindow.closed)
{ fabricsWindow = window.open(fabrics, 'fredRain',
'width=600,height=400,resizable=yes');
}
else
{
fabricsWindow.focus();
};
}


Javascript links defeats features and settings in tab capable browsers.
Some 8-12% of users turn off javascript: so the link as coded will
prevent them from accessing the wave.html resource.

"Users hate unwarranted pop-up windows. When they want the destination
to appear in a new page, they can use their browser's 'open in new
window' command -- assuming, of course, that **__the link is not a piece
of code that interferes with the browser's standard behavior__**."
Jakob Nielsen, Top Ten Web-Design Mistakes of 2002,
6. JavaScript in Links,
http://www.useit.com/alertbox/20021223.html

DU

===========================================================================

Right, thanks for this, drunclear, I appreciate it. The bit about javascript
and tabbed browsing was unknown to me though I sometimes use tabbed browsing
on some browsers! I will need to make further provision for the 8-12% who
turn js off (for whatever motivation if intentional)

My user chosen links that pop up (to show fabrics and stuff in small windows
without losing their place on the main window) are known to be truly useful
to most users. The window being the right size for the job, being a fixed
window that changes content according to what fabric is wanting to be
viewed. It will not be replaced without loss of elegance I fear, I don't
like the idea of a complete full window or tab for this. I need to put my
thinking cap on.

The fact is that most users don't set their browser preferences at all,
hardly know about such things. The tab capable browsers that I have actually
used or seen must have been from the 88-92% of them with javascript enabled!
I also hate unwarranted pop ups. On the machine that I noticed the problem
(running Safari) the popup window came up but was totally wrong in size
(absurdly tiny) and I don't know if it had javascript turned off (I saw no
provision for this in preferences and seemingly very little user settable
things - but I do not thoroughly know this!)

dorayme

PS. As I understand your point about focus, it seems it is useful in my
case. But I guess I should drop the "older browsers" bit ...
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top