invoke link click event in Navigator

  • Thread starter news.btinternnet.com
  • Start date
R

RobG

news.btinternnet.com wrote:

News group etiquette is to write your reply directly beneath a quote of
what you are replying to - that way readers are likely to know what you
are replying to. It also helps to explain why top posting is abhorred.

You appear to be using Outlook Express, which by default puts the
cursor above the quoted text. This is likely intended to allow you to
read from the top and scroll down through the text, you should not just
start typing your reply without regard for others trying to understand
your response.

Some readers of this forum receive the messages as an email. They do
not necessarily see a nice, threaded set of messages. The message
that you are responding to may be in some other e-mail, making it
difficult for e-mail based subscribers to follow the thread. Some of
these users are able to contribute significant knowledge to the group -
annoying them by making your posts hard to follow just means they won't
bother to help you out, they will spend their time helping those that
show consideration for others.

Users who just look at the most recent posts (a very efficient way to
scan posts) are also discouraged from replying. If they see a single
comment out of context they will likely just ignore it. To attempt to
understand your post they must to change to a threaded view, search
through a number of posts in an attempt get the context, then decide
whether to reply or not.

The best practice is to delete anything that you are not replying to
and write your response immediately below the bits that are relevant.
That way anyone reading the post has some idea of the context of your
reply without further effort.
The ancient link you sent me, it does not work in NN 7.2

The link definitely does 'work' in Netscape 7.2 (at least on the one
installed on my PC). But there is no point in pursuing it as the code
was old, it was only really relevant to Netscape Navigator up to
version 4 and did not help your cause of trying to soft-click a mailto:
link.

The bottom line is that the A element does not have a click method
defined in the W3C HTML 4 specification and neither Netscape or Firefox
provide one.

Replacing window.location.href with the href of the A element works as
well as can be expected. If the user has a mail client configured and
JavaScript enabled, then something happens. For me, Netscape kept
opening its own mail client, not my preferred mail client (but I
suspect that is an install problem and not a 'bug' in Netscape). IE
and Firefox opened the correct mail client.

Here is some code with the correction suggested by DU. It's been
tested in IE, Firefox and Netscape 7.2:


<a id="mto" href="mailto:[email protected]">mailto</a><br>
<input type="button" value="Click the mailto..."
onclick="clickIt('mto');">

<script type="text/javascript">
function clickIt(x){
var myLink = ( document.getElementById )?
document.getElementById(x) : document.all[x];
if ( myLink.click ) {
myLink.click();
} else if ( myLink.href ) {
if ( ! myLink.onclick ) {
window.location.href = myLink.href;
} else {
if ( false != myLink.onclick() ) {
window.location.href = myLink.href;
}
}
}
}
</script>


But all that seems way over the top. Why not just replace the href
from the button's onclick event:

<input type="button" value="e-mail me..." onclick="
window.location.href = 'mailto:[email protected]';
">
 
N

news.btinternnet.com

Thanks, but I really do not need an lesson in etiquette from you. Normally I
follow the prescribed format, however there are times when bevity is forced
by circumstance and that was one of those times. The 'Ancient Link' you
provided definately did not work on my machine.

I will test the code you provided in your last post and let you know how it
works for me.

Thank you for your time in any case.

--
Terry Burns
http://TrainingOn.net
RobG said:
news.btinternnet.com wrote:

News group etiquette is to write your reply directly beneath a quote of
what you are replying to - that way readers are likely to know what you
are replying to. It also helps to explain why top posting is abhorred.

You appear to be using Outlook Express, which by default puts the
cursor above the quoted text. This is likely intended to allow you to
read from the top and scroll down through the text, you should not just
start typing your reply without regard for others trying to understand
your response.

Some readers of this forum receive the messages as an email. They do
not necessarily see a nice, threaded set of messages. The message
that you are responding to may be in some other e-mail, making it
difficult for e-mail based subscribers to follow the thread. Some of
these users are able to contribute significant knowledge to the group -
annoying them by making your posts hard to follow just means they won't
bother to help you out, they will spend their time helping those that
show consideration for others.

Users who just look at the most recent posts (a very efficient way to
scan posts) are also discouraged from replying. If they see a single
comment out of context they will likely just ignore it. To attempt to
understand your post they must to change to a threaded view, search
through a number of posts in an attempt get the context, then decide
whether to reply or not.

The best practice is to delete anything that you are not replying to
and write your response immediately below the bits that are relevant.
That way anyone reading the post has some idea of the context of your
reply without further effort.
The ancient link you sent me, it does not work in NN 7.2

The link definitely does 'work' in Netscape 7.2 (at least on the one
installed on my PC). But there is no point in pursuing it as the code
was old, it was only really relevant to Netscape Navigator up to
version 4 and did not help your cause of trying to soft-click a mailto:
link.

The bottom line is that the A element does not have a click method
defined in the W3C HTML 4 specification and neither Netscape or Firefox
provide one.

Replacing window.location.href with the href of the A element works as
well as can be expected. If the user has a mail client configured and
JavaScript enabled, then something happens. For me, Netscape kept
opening its own mail client, not my preferred mail client (but I
suspect that is an install problem and not a 'bug' in Netscape). IE
and Firefox opened the correct mail client.

Here is some code with the correction suggested by DU. It's been
tested in IE, Firefox and Netscape 7.2:


<a id="mto" href="mailto:[email protected]">mailto</a><br>
<input type="button" value="Click the mailto..."
onclick="clickIt('mto');">

<script type="text/javascript">
function clickIt(x){
var myLink = ( document.getElementById )?
document.getElementById(x) : document.all[x];
if ( myLink.click ) {
myLink.click();
} else if ( myLink.href ) {
if ( ! myLink.onclick ) {
window.location.href = myLink.href;
} else {
if ( false != myLink.onclick() ) {
window.location.href = myLink.href;
}
}
}
}
</script>


But all that seems way over the top. Why not just replace the href
from the button's onclick event:

<input type="button" value="e-mail me..." onclick="
window.location.href = 'mailto:[email protected]';
">
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top