Validating Pages

When creating your pages, it’s a great idea to make sure that you’re making sites that adhere to Web standards; such pages load quicker in modern browsers and are easier to maintain. The easiest way to check a page that you’re working on for valid code is by running it against the page validator maintained by the World Wide Web Consortium (W3C), at http://validator.w3.org. This bookmarklet, Script 17.13, checks the page currently shown in your browser for validity. It does this by taking the URL of the current page, passing it to the validator, and then opening a new window with the validator’s results, as shown in Figure 17.28.

Figure 17.28. Running your page against the W3C validator returns this happy result, if you’ve written ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.