JavaScript - - By Sam Deering

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

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 = jQuery.fn.live;
jQuery.fn.live = function( types, data, fn ) {
    // migrateWarn("jQuery.fn.live() is deprecated");
    if ( oldLive ) {
        return oldLive.apply( this, arguments );
    }
    jQuery( this.context ).on( types, this.selector, data, fn );
    return this;
};

source: https://github.com/jquery/jquery-migrate/blob/master/src/event.js

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 ) ||
ua.indexOf(“compatible”) https://github.com/jquery/jquery-migrate/blob/master/src/core.js

Sponsors