Skip to content

Latest commit

 

History

History

11-browser-environment

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

The Browser Environment

http://www.saregune.net/ikasi/hezigune/curso.php?curso=javascript&leccion=js_intro_dom
http://vkanakaraj.wordpress.com/2009/12/18/javascript-vs-dom-vs-bom-relationship-explained/
http://javascript.about.com/od/byexample/a/Javascript-By-Example_2.htm
http://stackoverflow.com/questions/4416317/what-is-the-dom-and-bom-in-javascript

http://stackoverflow.com/questions/1173165/how-to-guess-browser-compatibility-based-upon-dom-level

if (navigator.userAgent.indexOf('MSIE') !== -1) {
    // this is IE
} else {
    // not IE
}
  • Best solution to detect features in our browser is doing Feature Sniffing, this is, checking the existance of the object (method, array or property) we want to use
if (typeof window.addEventListener === 'function') {
    // feature is subported, let's use it
} else {
    // hmm, this feature is not subported, will have to
    // think of another way
}