ICT

Getting started with jQuery 1.9

 

jQuery 1.9 was released on January 15, 2013. several deprecated features have been removed to provide a slimmer, cleaner library in preparation for version 2.0. it will be the last to support IE6, 7 and 8

In making these changes, the team's goal was to fix behavior that makes jQuery inconsistent or hard to use, and in the process improve both file size and overall performance.

This list is deceptively foreboding. Most of these changes address special situations and edge cases, and a few are changes that have been widely requested where jQuery's historical behavior has been problematic. As a first step, the best way to see if your code works is to try it with both jQuery 1.9 and the Migrate Plugin as described below.

For now, this guide serves as an appendix to the standard jQuery API documentation, and those pages may not describe the behavior of version 1.9. Please be patient while we update the documentation for the individual pages at api.jquery.com to reflect the changes in 1.9.

Removed Features

This should not be considered a definitive list of removals, but they are the most likely to cause compatibility problems. As always, thorough testing is your best option…

jQuery.browser() — removed

.live() events — use .on() instead

.die() — use .off() instead

.andSelf() — use .addBack() instead

.add() — nodes are now returned in document order with disconnected nodes (those not in the document) at the end. All sets which contain disconnected nodes follow this behavior

.after(), .before(), .replaceWith() — now return an unmodified jQuery set

.appendTo, .insertBefore, .insertAfter, .replaceAll — if no elements can be selected by the target selector, e.g. $(elements).appendTo("#not_found")), the resulting set is now empty

Ajax events must be attached to the document — not a DOM node, i.e.$(document).ajaxStart(...); rather than $("#node").ajaxStart(...);

radio/checkbox click events — now returns the checked state rather than the state it would have been in if .preventDefault() were not called

Order of focus events — blur events on the previous element are now fired prior to focus events on the new element

jQuery(htmlString) — htmlString is only considered to be HTML (rather than a selector) if it starts with a ‘<’ character

.attr() — you should normally use .prop()

“hover” pseudo-event — “hover” is no longer supported as a synonym for “mouseenter mouseleave”

jQuery.ajax returning an empty JSON result — this is now considered to be malformed JSON and throws an error


    Did you enjoy this blog post? If so, then why not:
    SIGN UP RIGHT NOW FOR EMAIL UPDATES


    Our FacebookOur News LetterOur Twitter

    Recent Discussions

    A new version of Android – which was perviously outed on Google’s site for Andro...
    2 months ago 0 1061
    Cell C’s largest shareholder Oger Telecom is looking at selling its stake in the...
    2 months ago 0 843
    &lt;blockquote&gt;A study by anti-depressant pharmaceutical firm Pharma ...
    2 months ago 0 853
    Vodacom has confirmed that the recent deal between its parent company Vodafone a...
    2 months ago 0 708
    Unit 6 at Eskom's newly-built Medupi power station in Limpopo produced power for...
    2 months ago 0 822

    Social Login


    Latest student Jobs

    Ask a Question

    FOLLOW US ON TWITTER

    Follow us on Google+