JAVASCRIPT- The Window– CHAPTER 5

Properties: location — current URL

protocol

host

hostname

port

pathname

search

hash

Browser Information:

The Navigator object: properties – appName,appVersion,userAgent,platform

Browser sniffing using navigator.userAgent
// Define browser.name and browser.version for client sniffing, using code
// derived from jQuery 1.4.1. Both the name and number are strings, and both
// may differ from the public browser name and version. Detected names are:
//
// “webkit”: Safari or Chrome; version is WebKit build number
// “opera”: the Opera browser; version is the public version number
// “mozilla”: Firefox or other gecko-based browsers; version is Gecko version
// “msie”: IE; version is public version number
//
// Firefox 3.6, for example, returns: { name: “mozilla”, version: “1.9.2” }.
var browser = (function() {
var s = navigator.userAgent.toLowerCase();
var match = /(webkit)[ \/]([\w.]+)/.exec(s) ||
/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(s) ||
/(msie) ([\w.]+)/.exec(s) ||
!/compatible/.test(s) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(s) ||
[];

return { name: match[1] || “”, version: match[2] || “0” };
}());

The Screen Object

window.screen

Error Handling

window.onerror

Advertisements

About Saran

Hello there!!! I'm Saravanan, born and living in India. The main reason i decided to start this project it was because there should be a way to transfer my knowledge which i experimented in flash to all. i try to concentrate as much as possible all kind of issues can appear to someone is developing an Flash application. If you need help, or if you would like to see in this blog some issues, send me an e-mail to rksaran@rediffmail.com Follow Me: twitter:http://twitter.com/rksaran Best Regards, SRK
This entry was posted in JavaScript, MyStudy. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s