W3C Validator Javascript
I used to like some small unobtrusive links to the various W3C html and css validators at the bottom of my pages. Instead of mainting these links by hand I decided to write some litte Java for the task. The solution I came up with is W3C compliant in that browsers not capable of Javascript simply won’t display the links.
Here is the code for the Java function which I placed in the validator.js
file:
The function is included in the html page by placing the following between the <head>
and </head>
tags:
<script src="validator.js" type="text/javascript"></script>
Now that this function is available in the page, it is used on the page by placing this code in the body of the page:
<script type="text/javascript">
<!-- // For browsercompatibility
validator();
// -->
</script>