Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

29 June 2011

How to be sure that you always use lastet version of jQuery?

This is solution only for bunch of daredevils  who doesn't care about stability and belive in "No risk,No fun" solutions.

!! For stability, safely and performance reasons is better to use local stored jquery framework !!

If you want be sure that you always import lastest version of jquery, then you should import this from jQuery website using this script (in head section):
<script src="http://code.jquery.com/jquery-latest.js"></script>

How to use (or detect) browser name in JQuery ?

Solution works in jQuery 1.6.1 (It should works from jQuery 1.1.3 or at least 1.4 (in 1.4 they changed way of detect browsers based on webkit engine like Mozilla, Chrome ,but I am too lazy bastard to check this out,sorry)

For some mysterious reasons jQuery doesn't offer property name for browser which should looks as simple as   $.browser.name  but NO. jQuery doesn't offer that , so what to do ?
use this piece of code instead:

jQuery.uaMatch(navigator.userAgent).browser