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

clarification: dhtml and closing the browser window

P: n/a


thanks to all that replyied to my previous post with the following code
in question:

<a href="merc.htm" target="_new_merc" onfocusout=window.close
class="left_link">

i understand that the people don't like the idea of closing the browser
window because it's annoyance to the user

however in my code it is *me* who opens the target window for the
specific purpose of viewing it only once. when the user leaves the
window I want it closed. It seems to me that the "target" attribute of
<a> tag is even more annoying without closing the "_new" window: say
the user went out about their business and in 10 minutes they click the
link again and *nothing* happens because the "_new" window is open but
without focus and the novice user wouldn't know what's going on.

the issue in question is that "onfocusout" seems to be microsoft
extension and not part of the standad HTML

udnder

http://www.w3.org/TR/REC-html40/inte....html#h-18.2.3

there is no "onfocusout" event

but uunder

http://msdn.microsoft.com/library/de...ence_entry.asp

there is "onfocusout"
So I am not clear on the following

1. Is dhtml a microsoft extension of html?

2. why wouldn't my code work in IE even if it is?

Nov 9 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Els
bb***@hotmail.com wrote:
thanks to all that replyied to my previous post with the following code
in question:
Please don't start a new thread when it's about the same subject
still, and please quote the relevant parts of the message you are
replying to.
This is easy to, even when using Google Groups:
http://www.safalra.com/special/googlegroupsreply/
<a href="merc.htm" target="_new_merc" onfocusout=window.close
class="left_link">

i understand that the people don't like the idea of closing the browser
window because it's annoyance to the user
Correct.
however in my code it is *me* who opens the target window for the
specific purpose of viewing it only once. when the user leaves the
window I want it closed. It seems to me that the "target" attribute of
<a> tag is even more annoying without closing the "_new" window: say
the user went out about their business and in 10 minutes they click the
link again and *nothing* happens because the "_new" window is open but
without focus and the novice user wouldn't know what's going on.
Yes, that is indeed an annoyance. But I know that there is a good
solution for that. I don't know how, but I do know some sites open
popups that get reused, and upon reusing the same popup window, it is
brought to the front, with focus. I think you'd better explore that
option instead, which eliminates your initial problem I think.

Of course, the best option altogether, is to avoid popup windows. Just
let the new page load in the current window, so that users can use
their backspace button to go back to where they were.
So I am not clear on the following

1. Is dhtml a microsoft extension of html?

2. why wouldn't my code work in IE even if it is?


Sorry, I have no idea whatsoever.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Nov 9 '05 #2

P: n/a
On 9 Nov 2005 00:31:05 -0800, bb***@hotmail.com wrote:
i understand that the people don't like the idea of closing the browser
window because it's annoyance to the user

however in my code it is *me* who opens the target window for the
specific purpose of viewing it only once. when the user leaves the
window I want it closed.
So are you saying that the convenience of the user is unimportant to
you? If not, what?

If the focus switches before the user has read the window in question,
does it matter that (s)he never gets to see it? If not, why display the
window at all? If so, it doesn't make sense to close it, does it?
It seems to me that the "target" attribute of
<a> tag is even more annoying without closing the "_new" window: say
the user went out about their business and in 10 minutes they click the
link again and *nothing* happens because the "_new" window is open but
without focus and the novice user wouldn't know what's going on.
Agreed. (I would add that the experienced user may well not know what is
going on either.) That is one reason for not using the target attribute.
Though if you combine it with some well-thought-out Javascript you can
at least avoid that issue for many readers.

I would say that you should only use the target attribute if you have
good reasons for supposing that most readers will prefer to see both the
old and new windows at the same time - something like a glossary for
example. And in that case you certainly shouldn't be closing one of the
windows unasked.

So I am not clear on the following

1. Is dhtml a microsoft extension of html?
DHTML doesn't really exist. It's a marketing slogan covering the
combination HTML + Javascript + DOM.
2. why wouldn't my code work in IE even if it is?


Don't you want it to work in a browser?

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Nov 9 '05 #3

P: n/a
bb***@hotmail.com wrote :

thanks to all that replyied to my previous post
Where is your other post?
Is it in another newsgroup?
Where exactly do you want to see replies to your post?
Wasn't it more simpler to just post all your questions into a single
thread? Why make things more complicated for people reading your posts
and trying to bring you assistance?
Is there a particular reason as to why you want to fragment the
discussion on your posts?
Or is it that you want to read certain answers to a post somewhere and
want to read another type of answers to your post in another unrelated
thread?

with the following code in question:

<a href="merc.htm" target="_new_merc" onfocusout=window.close
class="left_link">

i understand that the people don't like the idea of closing the browser
window because it's annoyance to the user

Just imagine: would you like NBC, CBS or ABC to close your tv just
because you switch to another channel? Would you like NBC, CBS or ABC to
turn off your working washing machine because its noise can interfere
with the listening of their NBC/CBS/ABC tv show going on in your tv?
however in my code it is *me* who opens the target window for the
specific purpose of viewing it only once.
Are you actually implying or suggesting that only *_you_* should be able
to open windows and close windows on an user screen regardless of what
such user would or could have to say about your own manners?
when the user leaves the
window I want it closed.
Then it should be the same for NBC, CBS and ABC: they should be able to
turn off your tv set when you switched your tv to a competitor channel.
Some of them should have agreements with Sony, Toshiba, JVC, and other
TV manufacturers to implement such feature on an automatic mode.

It seems to me that the "target" attribute of <a> tag is even more annoying without closing the "_new" window:
I don't know if others told you so already
(see what happens: either I don't know or I'm repeating again something
that you were told already ... all because you intentionally fragmented
the discussion into separate threads) but you can not have a target
attribute value starting with "_" unless when using the reserved
keywords for this.

target="_new" or target="_new_merc" are invalid markup code

http://www.w3.org/TR/html401/types.h...e-frame-target

say
the user went out about their business and in 10 minutes they click the
link again and *nothing* happens because the "_new" window is open but
without focus and the novice user wouldn't know what's going on.
What you're describing is the nr 1 usability problem with requested
popup windows. What you're describing is a very well known problem with
the windowing management system of most os-es.

There is nothing you can do to prevent this when javascript support is
disabled or inexistent. If javascript support is enabled, then you can
use the focus() method after proper testing when the window loses focus.

the issue in question is that "onfocusout" seems to be microsoft
extension and not part of the standad HTML

udnder

http://www.w3.org/TR/REC-html40/inte....html#h-18.2.3

there is no "onfocusout" event

but uunder

http://msdn.microsoft.com/library/de...ence_entry.asp

there is "onfocusout"
So I am not clear on the following

1. Is dhtml a microsoft extension of html?
No.
2. why wouldn't my code work in IE even if it is?


Maybe because MSIE supports proprietary extensions and IE-specific code
which has nothing to do with W3C web standards.
And maybe because the window object is not defined as a W3C DOM object
nor as a HTML object to begin with: the window object is a DOM 0 object.
Where you told and explained all this in your other thread?

Grard
--
remove blah to email me
Nov 9 '05 #4

P: n/a
Stephen Poley wrote :
On 9 Nov 2005 00:31:05 -0800, bb***@hotmail.com wrote:
It seems to me that the "target" attribute of
<a> tag is even more annoying without closing the "_new" window: say
the user went out about their business and in 10 minutes they click the
link again and *nothing* happens because the "_new" window is open but
without focus and the novice user wouldn't know what's going on.

Agreed. (I would add that the experienced user may well not know what is
going on either.)


Well, it depends if WCAG/WAI recommendations, usability recommendations
have been followed too.

"Users often don't notice that a new window has opened, especially if
they are using a small monitor where the windows are maximized to fill
up the screen. So a user who tries to return to the origin will be
confused by a grayed out Back button."
The Top Ten New Mistakes of Web Design: 2. Opening New Browser Windows,
Jakob Nielsen, May 1999
http://www.useit.com/alertbox/990530.html

"If your link spawns a new window, or causes another windows to 'pop up'
on your display, or move the focus of the system to a new FRAME or
Window, then the nice thing to do is to tell the user that something
like that will happen."
World Wide Web Consortium Accessibility Initiative regarding popups
http://www.w3.org/WAI/wcag-curric/sam77-0.htm

"Use link titles to provide users with a preview of where each link will
take them, before they have clicked on it."
Ten Good Deeds in Web Design, Jakob Nielsen, October 1999
http://www.useit.com/alertbox/991003.html

Using Link Titles to Help Users Predict Where They Are Going, Jakob
Nielsen, January 1998
http://www.useit.com/alertbox/980111.html

More on this:
http://developer.mozilla.org/en/docs...ese_guidelines
That is one reason for not using the target attribute.
Though if you combine it with some well-thought-out Javascript you can
at least avoid that issue for many readers.

I would say that you should only use the target attribute if you have
good reasons for supposing that most readers will prefer to see both the
old and new windows at the same time - something like a glossary for
example.


In such case, the use of target attribute for users with js disabled
makes sense.

Grard
--
remove blah to email me
Nov 9 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.