Client-side JavaScript to how to detect operating systems, browsers, mobile phones and other information about whether the source code is the practice of object-oriented style of JavaScript.
Web development is sometimes necessary to determine the client's platform or browser,
Detect the type of browser pages in ASP.NET Web Server side, you can see the MSDN example: http://msdn.microsoft.com/zh-tw/library/3yekbd5b(v=vs.80).aspx
Sometimes using a blog or Plug in into the control of grammar, such as: facebook community tools - message board
When possible trouble viewing on mobile phones, will need to be detected through the Client-side JavaScript,
In JavaScript navigator object provides several properties through, it can determine whether the mobile phone, finishing summary table below:
I refer Since http://www.quirksmode.org/js/detect.html get a little processing paradigm in mind:
- Increase the object's properties (IsMobile): it can be determined whether the mobile phone.
- Increase identify the operating system: Windows Phone 7
Test URL directly in the browser: http://robin.somee.com/BrowserDetect/Test_BrowserDetect.html
View from the personal laptop results
View from the WP7 (HTC mozart) results
Interested please download the full value of the property and various examples of mobile browser navigator objects: here
The original file BrowserDetect.js program to practice in JavaScript object-oriented style, there are reference value.
Original: Big Box JavaScript Client-side detection platform