473,603 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

activating a link

i've got a link that i give focus to via accesskey.

<a href="blah" accesskey=p>

in IE, that just gives it focus, but does not activate it.

how do i activate the link.

thx.
Jun 3 '06 #1
12 3775
ppcguy wrote:
i've got a link that i give focus to via accesskey.

<a href="blah" accesskey=p>

in IE, that just gives it focus, but does not activate it.
how do i activate the link.


The solution below is somewhat hokey, but it works in both Firefox and
IE 6. FF accepts an access key directly on the link (that accesskey=h
is for testing purposes). FF also lets you do
style="visibili ty:hidden" in the button element instead of
style="width:0p x". I expect use of this method is an oversight on the
part of IE and wouldn't rely on it too heavily.

<form action='http://google.com' method=get>
<button type=submit style="width:0p x" accesskey=g></button>
<a href="http://google.com" accesskey=h><u> G</u>oogle</a>
</form>

Csaba Gabor from Vienna

Jun 3 '06 #2
VK

ppcguy wrote:
i've got a link that i give focus to via accesskey.

<a href="blah" accesskey=p>

in IE, that just gives it focus, but does not activate it.

how do i activate the link.


<a href="http://www.google.com"
accesskey="t"
onfocus="locati on.href=this.hr ef">Test</a>

That covers both.

Jun 3 '06 #3
VK wrote:
ppcguy wrote:
i've got a link that i give focus to via accesskey.

<a href="blah" accesskey=p>

in IE, that just gives it focus, but does not activate it.

how do i activate the link.


<a href="http://www.google.com"
accesskey="t"
onfocus="locati on.href=this.hr ef">Test</a>

That covers both.


Ahem. Let's hope the users are not fans of the tab key. If they are,
they are in for a bit of a surprise. Not to mention clicking on the
link and moving the mouse away before releasing the button.

Csaba

Jun 3 '06 #4
VK
Csaba Gabor wrote:
VK wrote:
<a href="http://www.google.com"
accesskey="t"
onfocus="locati on.href=this.hr ef">Test</a>

That covers both.
Ahem. Let's hope the users are not fans of the tab key. If they are,
they are in for a bit of a surprise.


Links are included into taborder by default, so navigation by tab
doesn't affect the above method. No surprise.
Not to mention clicking on the
link and moving the mouse away before releasing the button.


"Click" is defined as the sequence of "mousedown"-"mouseup" events on
the same point. So the event above is not clicking and the navigation
by link is not presumed - moreover must be prevented.

Jun 4 '06 #5
VK wrote:
Csaba Gabor wrote:
VK wrote:
<a href="http://www.google.com"
accesskey="t"
onfocus="locati on.href=this.hr ef">Test</a>

That covers both. Ahem. Let's hope the users are not fans of the tab key. If they are,
they are in for a bit of a surprise.


Links are included into taborder by default,


In some browsers, not others. In some it is a preference setting.

Your method also has the drawback that, having navigated to the new URL,
if the 'back' button is used, the link is still in focus so you go
straight back to the new URL.

Very user-unfriendly.

... so navigation by tab doesn't affect the above method. No surprise.


Big surprise really. Suppose you are tabbing to some other link and on
the way put focus on an 'auto navigate' link - use the back button or
key combo to go back - WTF? You're stuck at the new URL.

Not to mention clicking on the
link and moving the mouse away before releasing the button.


"Click" is defined as the sequence of "mousedown"-"mouseup" events on
the same point. So the event above is not clicking and the navigation
by link is not presumed - moreover must be prevented.


You're right, it's not a click, it's a drag. You completely missed the
point though.

Your solution isn't based on a click, it's based on focus. It will
still navigate to the new URL even though it did not receive a click
event because the link keeps focus.

The whole purpose of dragging a link would be to drop it elsewhere (new
tab, page whatever) and leave the current page at the current URL. But
your method leaves both windows at the new URL.

Really, really user-unfriendly.
--
Rob
Jun 4 '06 #6
VK said the following on 6/4/2006 1:38 AM:
Csaba Gabor wrote:
VK wrote:
<a href="http://www.google.com"
accesskey="t"
onfocus="locati on.href=this.hr ef">Test</a>

That covers both.

Ahem. Let's hope the users are not fans of the tab key. If they are,
they are in for a bit of a surprise.


Links are included into taborder by default, so navigation by tab
doesn't affect the above method. No surprise.


What is "No surprise" is your lack of the first clue about what the
problem would be.

Hint: Tabbing through the links to get to the next one puts focus on the
link.

I doubt you get the hint and understand it's ramifications so read Rob's
response. I don't care to try to explain common sense to you today.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 4 '06 #7
ppcguy wrote:
i've got a link that i give focus to via accesskey.

<a href="blah" accesskey=p>

in IE, that just gives it focus, but does not activate it.

how do i activate the link.

thx.

May be too late, but it sounds like your question doesnt need a js
solution. In IE hitting ALT + accesskey value will only give focus; you
then have to hit enter to activate it. So, to answer your question
literally, you would do ALT+p+ENTER.

Jun 6 '06 #8
er**********@gm ail.com said the following on 6/6/2006 5:47 PM:
ppcguy wrote:
i've got a link that i give focus to via accesskey.

<a href="blah" accesskey=p>

in IE, that just gives it focus, but does not activate it.

how do i activate the link.

thx.

May be too late, but it sounds like your question doesnt need a js
solution. In IE hitting ALT + accesskey value will only give focus; you
then have to hit enter to activate it. So, to answer your question
literally, you would do ALT+p+ENTER.


Or ALT+p+SPACE

Try it :)
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 6 '06 #9
VK
Randy Webb wrote:
VK said the following on 6/4/2006 1:38 AM:
Links are included into taborder by default, so navigation by tab
doesn't affect the above method. No surprise.


What is "No surprise" is your lack of the first clue about what the
problem would be.

Hint: Tabbing through the links to get to the next one puts focus on the
link.


i) nothing is lost for the US soccer team yet - keep watching.

ii) German beer is the best - confirmed so many times, yet again.

iii) Euro Summer weather is much better as I could expect.

iv) The OP task was to navigate to a link on focus - this IMHO clearly
eliminate the option to navigate across the links on the same page
using TAB - really either you shift focus from link to link on TAB or
you navigate away on focus - but you cannot do the both on the same
event (focus). However user friendly it is - it is for OP's
considerations.

Jun 16 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2084
by: Bill | last post by:
Is it possible to somehow activate a page containing a php script by sending an email to a mailbox on the server? I have a script that sends out notification emails to an individual. He wants to receive them continuously until he decides he has seen enough of them. Then to stop receiving the emails he has to use his browser and go to the web page that is sending him the emails where he clicks a button. Would it be possible to arrange...
3
1584
by: Ruskin Hardie | last post by:
Ok, I am still playing with ASP and was wondering how to do this (it seemed simple). What I want is to have a hyperlink that when it's clicked on, will run a sub routine, instead of opening a web page... Right now I have; Sub CreateLinks() Response.Write "<br><br>" Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>" Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>" Response.Write "<a...
1
2656
by: Jeppe 1971 | last post by:
Hi Does anyone know of a way to load a HTML-page and examine the document without activating the code? I am trying to create a search-function in javascript. The idea is that the function goes through all the HTML-pages on a site looking for words entered by the user. The results is thereafter presented to the user (it's a kind of a search-engine).
6
3622
by: SF RVN | last post by:
Hmmmm.. a wee bit of a problem: Background default.htm has a left-aligned table serving as a 'navigation menu' and a right-aligned iFrame (named 'viewframe') serving as the 'target' for left-side menu. I think of iFrame as 'child page'. Example: Clicking a left menu item (link to initiation.htm) loads initiation.htm in iFrame. iFrame height is automatically adjusted by SCRIPT LOCATED
12
2056
by: magmike | last post by:
When users of my site submit articles to our database (http://www.netterweb.com/articles/) they almost always have http:// addresses within the text. They are pasting that text into a box which saves to a memo field. When displayed through results on a webpage, the links are inactive, unless the user was knowledgable enough to use html within the text. However, most of my users are not html savvy. Is there a way I can code the results of...
3
1619
by: Spartanicus | last post by:
I have a list of links using the following construct: <a href='#artane' onclick='pos(1107,281)'>Artane</a> The links offer additional functionality through JS. There are no actual fragment IDs on the page, but the fragment coding allow the links to be bookmarked. Via the window.onload event I check if a fragment ID is present in the address, if so I need to activate the 'pos' function with the appropriate arguments.
10
4060
by: Carlos Araya | last post by:
I have the following link on a web page <p class="menuitem"><a href="#" onclick="loadFragment('http://rivendellweb.net/fortress/home', 'index')" title="The Fortress Home">The Fortress Home</a></p>
0
7996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8415
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8273
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6735
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3951
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.