Click to See Complete Forum and Search --> : buttons
David Harrison
04-30-2003, 01:24 PM
How do I get a button to as a link?
I've tried onclick="loaction.href='123.html'" and document.href, I've even tried to tell it to run the function {location/document.href="123.html";}
This should work:
<input type="button" value="Go somewhere" onclick="window.location.href='http://www.w3c.org';">
Charles
04-30-2003, 01:47 PM
That will fail one in ten times. Try instead:
<form action="http://www.w3.org/TR/html4/">
<div>
<input type="submit" value="HTML 4.01">
</div>
</form>
David Harrison
04-30-2003, 01:55 PM
Will it fail because it uses js? If so it doesn't matter because you can't see any of the content on my site because it's all locked up in a .js file.
Charles
04-30-2003, 02:40 PM
I understand that you Easterners have rather strict laws regarding that sort of thing (http://elj.warwick.ac.uk/jilt/01-2/sloan.html). Perhaps you ought to rethink your site.
David Harrison
04-30-2003, 02:57 PM
What has someone being disabled got to do with whether or not I use js?
Plus, I'm sorry charles but you're always saying that we should never use js but this is a js forum, the people in here want to use js in their sites.
But, when Charles points out ways to do things without using javascript, I, for one, say we listen... Often times it can just as easily be done so it will work for those without javascript as well...
Charles
04-30-2003, 03:09 PM
I've never once suggested that one ought not to use JavaScript and I have provided numerous examples of its use. I have, however, insisted that it be used in such a way that the page will still work for the one in ten users that do not use JavaScript. Some people with certain disabilities cannot use browsers that support JavaScript and that is why the Web Content Accessibility Guidelines 1.0 require that you "Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page." (http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-scripts). And a happy side-effect will be that your page will become opaque to search engines.
David Harrison
04-30-2003, 03:21 PM
What do you mean by "opaque to search engines"?
Charles
04-30-2003, 03:27 PM
It can be seen by search engines. As opposed to something that is transparant and cannot be seen.