Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery 1.9.0 List of Deprecated, Removed, and Changed functionality since 1.6.4 [closed]

We are currently upgrading jQuery in our application from jQuery 1.6.4 to 1.9.0.

I believe I have gotten the majority of the changes fixed in our application, however, I would like to be able to go from a semi-solid list of functional jQuery changes to be sure.

As of right now, the only two major changes I see are the removal of the .live and the $.browser features.

There were also some issues that resulted in us upgrading jquery UI to the latest as well.

We have a large application that we finally got the approval to drop support for IE 6 and therefore are trying to bring it closer to the modern age.

I'm not looking for a complete change log for each version, as the change logs include a lot of stuff I don't really care about. Hopefully this will help others in their upgrade process as well.

What I am looking for: Deprecated functions, Removed functions, Important functional changes such as the old attr and prop

What are the deprecated, removed functions, and important functional changes since jQuery 1.6.4 to 1.9.2...

like image 253
teynon Avatar asked Jan 17 '13 17:01

teynon


2 Answers

Since this question may be closed, it makes sense as nhahtdh suggested to submit an answer to be able to edit and add information later. Feel free to make changes to add additional change notes and even increase this to the latest versions of jQuery (1.10)

>= jQuery 1.6.4

No significant changes noted

>= jQuery 1.7.1

No significant changes noted

>= jQuery 1.7.2

From Docs: If you’re using jQuery Mobile, please use jQuery 1.7.2 only with jQuery Mobile 1.1. For previous versions of jQuery Mobile, stay with jQuery core 1.7.1 or earlier.

>= jQuery 1.8.0

Core changes to watch:

  • animations - core changes
  • CSS Prefixing

    • From jquery:

      When you use a CSS property, in either .css() or .animate(), we’ll use the correct prefixed property (when appropriate) for that browser. For example, take .css("user-select", "none"); in Chrome/Safari we’ll set the value as "-webkit-user-select", Firefox will use "-moz-user-select", and IE10 will use "-ms-user-select".

  • data:

    The .data() method had an undocumented and incredibly non-performant way to monitor setting and getting of values that was removed in 1.9. This has affected the interpretation of data names that contain periods, in a good way. As of 1.9, a call to .data("abc.def") retrieves the data for the name "abc.def" only, and never just "abc". Note that the lower-level jQuery.data() method never supported events and so it has not changed. The jQuery Migrate plugin does not restore the old behavior for this case.

  • .curCSS: This one is an important one for me. Upgrading the the new jQuery UI fixed this issue, but it is important to note, that without upgrading, this will break various things.

    $.curCSS: This method was simply an alias for jQuery.css() from jQuery 1.3 onward. Although it has never been part of the documented API, some external code has been known to use it, perhaps thinking it was “more efficient.” Now it’s “more gone.”

>= jQuery 1.8.1

jQuery notes: Use jQuery UI 1.8.23 and jQuery Mobile 1.1.1 or later for best compatibility with jQuery core 1.8.1.

Don’t use Quirks mode! http://blog.jquery.com/2012/08/30/jquery-1-8-1-released/

>= jQuery 1.8.2

  • offset: This could effect a page that was expecting a value from offset to be off already in a specific browser. http://bugs.jquery.com/ticket/12536

MAKE .OFFSET() CALC LESS WRONG ON BROWSERS W/O GETBOUNDINGCLIENTRECT

>= jQuery 1.8.3

No significant changes noted

>= jQuery 1.9.0 from http://jquery.com/upgrade-guide/1.9/

  • .toggle(function, function, ... ) removed

    This is the "click an element to run the specified functions" signature of .toggle(). It should not be confused with the "change the visibility of an element" of .toggle() which is not deprecated.

  • jQuery.browser() removed

  • .live() removed

  • .die() removed

  • jQuery.sub() removed

  • .add() changes http://jquery.com/upgrade-guide/1.9/#add-

  • .addBack( selector ) replaces .andSelf() http://jquery.com/upgrade-guide/1.9/#addback-selector-replaces-andself-

  • .after(), .before(), and .replaceWith() with disconnected nodes

  • .appendTo, .insertBefore, .insertAfter, and .replaceAll

  • AJAX events should be attached to document

  • Checkbox/radio state in a .trigger()ed "click" event

  • Order of triggered "focus" events

  • jQuery(htmlString) versus jQuery(selectorString)

  • Events not fired by the .data() method; names with periods

  • Ordering of disconnected nodes within a jQuery set

  • Loading and running scripts inside HTML content

  • .attr() versus .prop()

  • $("input").attr("type", newValue) in oldIE

  • "hover" pseudo-event

  • .selector property on jQuery objects

  • jQuery.attr()

  • jQuery.ajax returning a JSON result of an empty string

  • jQuery.proxy() context

  • .data("events")

  • Removed properties of the Event object

  • Undocumented arguments of API methods

I will review and add to this later as I find more issues.

like image 172
2 revs Avatar answered Nov 07 '22 22:11

2 revs


Latest jQuery release is 1.9.0 and this is the upgrade-guide doc

http://jquery.com/upgrade-guide/1.9/

You can find these here:

Changes of Note in jQuery 1.9

  • .toggle(function, function, ... ) removed
  • jQuery.browser() removed
  • .live() removed
  • .die() removed
  • jQuery.sub() removed
  • .add()
  • .addBack( selector ) replaces .andSelf()
  • .after(), .before(), and .replaceWith() with disconnected nodes
  • .appendTo, .insertBefore, .insertAfter, and .replaceAll
  • AJAX events should be attached to document
  • Checkbox/radio state in a .trigger()ed "click" event
  • Order of triggered "focus" events
  • jQuery(htmlString) versus jQuery(selectorString)
  • Events not fired by the .data() method; names with periods
  • Ordering of disconnected nodes within a jQuery set
  • Loading and running scripts inside HTML content
  • .attr() versus .prop()
  • $("input").attr("type", newValue) in oldIE
  • "hover" pseudo-event
  • .selector property on jQuery objects
  • jQuery.attr()
  • jQuery.ajax returning a JSON result of an empty string
  • jQuery.proxy() context
  • .data("events")
  • Removed properties of the Event object
  • Undocumented arguments of API methods
  • Other undocumented properties and methods
like image 42
Jai Avatar answered Nov 08 '22 00:11

Jai