HAL-PC Web Technolgies SIG

Mail List | SIG Leader

Making javascript Links Accessible

HAL-PC Web Technologies SIG

Many times web developers/designers want to open a new window with a specific size, with or without toolbars. The most common way of doing that is to use javascript. This can present a problem for people who do not have javascript enabled or need assistive devices that do not support javascript. In either case the link will not function and can cause the page to jump to the top,

The following are the most commonly used javascript codes for opening pop-up.

<a href="#" onclick="window.open('it.htm, 'newWindow')"> click here </a>

<a href="javascript:window.open('it.htm', 'newWindow')" > click here </a>

Try using this instead:

<a href="it.htm" target="newWindow" onclick="window.open(this.href, this.target); return false"> click here </a>

If you need a window of specific dimensions opened try:

In the head section:

<script language="javascript">
<!-- new window
function openpopup(){
var popurl="it.htm"
winpops=window.open(popurl,"","width=200,height=200,")
}
-->
</script>

<a href="it.htm" target="newWindow" onclick="javascript:openpopup(); return false"> click here </a>

About Us | Site Map | Advanced Search | Privacy Policy | Contact Us | ©1999-2006 HAL-PC Web Technologies SIG Leader Cheryl D. Wise