javascript window

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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 =, 'fredRain',


    // End hiding script from old browsers -->

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

<a class="plain"
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.


Re: javascript window

dorayme wrote:
Quoted text here. Click to load it

The "hiding" from old browsers no longer makes sense really as everyone
uses something much better than NS 3. So, <!-- --> part is no longer needed.

Quoted text here. Click to load it

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.


var fabricsWindow = null; // global variable
  function newWindow(fabrics) {
if(fabricsWindow == null || fabricsWindow.closed)
    { fabricsWindow =, 'fredRain',

Quoted text here. Click to load it

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,

The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.3 :)

Quoted text here. Click to load it

Re: javascript window

Quoted text here. Click to load it


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!)


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

Site Timeline