Saturday, September 24, 2011

Some Notes on Best Practices and concepts

* The MIME standard can be used to tell the browsers about the automatic identification and handling of files. 

* We can mention the MIME type in a HTML page by using META tag. for example,
<meta http-equiv='Content-Type' content='application/xhtml+xml; charset=UTF-8' />

* Yellow Screen of Death (YSOD) occurs when a XHTML document is having any markup errors like missing tags, improper closing tags etc..

* As long as we are using XHTML1.0 we no need to worry about the MIME type, but if we are using XHTML1.1, must and should we have to mention the MIME Type(Typically application/xhtml+xml).

* Namespacing  is the concept of making our code to follow certain naming conventions thereby making our programs more portable, easy to maintain, avoiding the conflicts if we include our code in other documents of similar type.

* Unobtrusive JavaScript is the practice of separating out any JavaScript behavior code from your content structure(HTML) and presentation(CSS). With Unobtrusive JavaScript, only <script> tags that include external JavaScript files are allowed within your document. The goal is to eliminate the use of any <script> tags with inline JavaScript and the use of any HTML behavioral/event attributes, like onclick, onmouseover, etc, that make use of JavaScript from within the content markup itself, and externalize this code in a separate JavaScript file which gets included by a <script> tag with a "src" attribute. The idea here is that these externalized behaviors will get programmatically attached to the elements at some point during the document loading process, most likely after the window onload event fires, with the use of the DOM APIs which allow you to add/remove event handlers programmatically. For guidelines refer this URL : The 7 rules of Unobtrusive JavaScript.


No comments:

Post a Comment