Web Page Design and Hosting

July 29, 2007

Chapter 7: Moving Ahead with XHTML

Filed under: Web Design — webmaster @ 4:29 am

Chapter 7: Moving Ahead with XHTML 157 Because the ampersand is considered reserved for use, the more rigid rules of XHTML expect you to escape all inline instances of ampersands not related to a special character. Take the following URL, for example: http://www.molly.com/books/250.cgi?chapter=1&section=2 The ampersand must be escaped using the character entity: http://www.molly.com/books/250.cgi?chapter=1&section=2 The same is true in any inline or embedded JavaScript. Consider the following snippet from a routing script: if (browser == “Microsoft Internet Explorer” && navigator.appVersion==version) If this JavaScript appears as an embedded script, the ampersands must be escaped: if (browser == “Microsoft Internet Explorer” && navigator.appVersion==version) note Escaping characters in URLs or scripts will not affect the functions related to either. You do not need to do this for any external script. For more information on entities in XHTML and other helpful XHTML workarounds, see www.simonstl.com/tips/archive/workarounds.html. Secret #115: alt Attribute Required Unlike HTML, where the alt attribute is a recommended inclusion for accessibility purposes, you can t leave it out in XHTML. Incorrect: Correct: photograph of  molly There are no exceptions to this rule, even if you leave the value empty: However, since you can use CSS for effective spacing, spacer graphics are unnecessary anyway. note Interestingly, while width and height might seem presentational, they are available for use in strict DTDs and XHTML 1.1, because having width and height attributes present will assist with better graphic rendering in most browsers.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Unix Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting