Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Accessible Javascript Bookmarks

Is it possible to create a "Bookmark this page" hyperlink that uses accessible Javascript i.e. the script is specified in an onclick event handler rather than as the href target?

See here: http://diveintoaccessibility.org/day_13_using_real_links.html if you don't understand what I'm talking about.

John Topley (www.johntopley.com)
Friday, August 20, 2004

Move the javascript command into a function called by onClick. Example (not 'clean' :-):

<html>
<head>
<title></title>
<script>
function addTo(url) {
window.external.AddFavorite(location.href,url);
}
</script>
</head>
<body>
<a href="" onClick="addTo('www.telepark.de');">Add to Favourites</a>
</body>
</html>

As a side note: The article seems to be from 2002 and references thecounter.com stats from 2002.

The latest stat from July 2004 identifies 94%+ javascript-supporting browsers. Plus a 93% Microsoft Internet Explorer 5.x+ representation. Just for reference.

http://www.thecounter.com/stats/2004/July/browser.php

Disclaimer: statistics *can* be misleading.

Have a nice weekend

Patrick Thomas
http://www.telepark.de/webwizards

Patrick Thomas
Saturday, August 21, 2004

Thanks a lot, Patrick. It's not about whether or not Javascript is enabled, it's about accessibility.

John Topley (www.johntopley.com)
Saturday, August 21, 2004

Pleasure, John. And you are right about accessibility.

Cheers

Patrick Thomas
http://www.telepark.de/webwizards

Patrick Thomas
Sunday, August 22, 2004

*  Recent Topics

*  Fog Creek Home