mengu on web programming.

jQuery OS Detection

Windows doesn't have Lucida Grande font by default so my visitors from Windows was reading my posts with the default browser font. I wanted to change the font-family property for Windows users from Lucida Grande to Lucida Sans Unicode. I have searched and found a plugin to detect client's operating system with jQuery.

Many thanks go to Stoimen for this plugin. You can download the plugin here and you can see the plugin in action here.

Usage of the plugin is very simple. $.client.os returns the client's operating system and $.client.browser returns the client's browser. How I used this plugin is also very simple:

$(document).ready(function(){
    if ($.client.os == "Windows")
    {
        $(".post").css('font-family', 'Lucida Sans Unicode, sans-serif');
    }
});

Again, I'd like to thank Stoimen for this plugin.

Comments

No comments made for this post.

Leave a Response

Name*:
E-Mail* (not published):
Web site:
Response: