By Sam Deering

Backwards Support for $.live() and $.browser()

By Sam Deering
Last chance to win! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

Quick code snippets from the jQuery Migrate Plugin. I recommend using the full migrate plugin but if you want specifics for $.live() and $.browser() see below.

var oldLive =; = function( types, data, fn ) {
    // migrateWarn(" is deprecated");
    if ( oldLive ) {
        return oldLive.apply( this, arguments );
    jQuery( this.context ).on( types, this.selector, data, fn );
    return this;


var browser;


jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();

var match = /(chrome)[ /]([w.]+)/.exec( ua ) ||
/(webkit)[ /]([w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ /]([w.]+)/.exec( ua ) ||
/(msie) ([w.]+)/.exec( ua ) ||

Login or Create Account to Comment
Login Create Account
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?