code { padding: 2px; background-color: #f4f4f4; color: #7f0055; font-weight: bold; border: solid 1px #ddd; } blockquote { margin-left: 1em; font-size: 12px; line-height: 17px; background-color: #fdfdfd; border: solid 1px #ccc; padding: 4px; font-style: normal; }
I was developing a system that I am currently developing by installing the latest jQuery 1.9.1, and I got hooked on a jQuery plugin that was running on the system I was developing last month and was supposed to implement the same thing, but it didn't work. It was the "thickbox" that came with the WordPress core, and I wondered why it worked in the admin panel but not on the theme side, and when I looked it up, I found that there was a difference between the 1.8 series and the 1.9 series of the core jQuery that was loaded. If you look up the specification changes of the jQuery 1.9 series, you will find that the methods that have been quite useful until now are gone.
I knew it would be deleted in the future, but '$.browser()', which I used because it was easy to use, and '$.live()', which was useful because it was more versatile than '$.bind()', which was less adaptable to dynamically generated DOM objects, were deleted. jQuery plugins that use these methods are now getting errors.
With that said, I summarized the main specification changes in jQuery 1.9.
'$.browser()' has been designated as unsupported since the deprecation of 1.3, but the method has finally been deleted... It was easy to use because you can easily judge the browser, but it can't be helped. From now on, we have to use '$.support()' to set up a judgment expression.
'$.live()' is deprecated
An extended method of '$.bind()' that allows bind to be unable to bind processing to dynamically generated objects in jQuery or JavaScript. This was also easy to use and useful, but it has been discontinued. From now on, you can use '$.on()' and '$.off()'. Well, this one is definitely smarter because you can easily control the bind event on and off.
- '$.die()' is deprecated
This is the method that deletes the live function above. If there is no live, this is also unnecessary.
- '$.sub()' is deprecated
A method that creates a copy of a core jQuery object whose properties and methods can be freely modified. It was used in plugin development to extend the jQuery core independently without changing the core, but there may have been a decision that there would be no plug-in that would copy the huge jQuery core itself and eat up memory. Well, it's a method that isn't used much by anyone other than plug-in developers, and it seems that this method itself has been plugged in since the 1.8 series, so I don't think the impact of its abolition will be low.
- `$.toggle(fn1(),fn2(),[... deprecation of fnN()])'
This method was deprecated in the 1.7 series. It was a method that could execute functions such as fn1, fn2, and fnN every time a specified object was clicked, and then return to fn1 after fnN. Well, how about the UI that you have to change the processing to that extent with each click? So I thought it was appropriate to abolish it. Oh, by the way, '$.toggle()' for event effect types that are not function-bound has not been deprecated.
- Other methods with changed description order and processing content
It seems that various details have changed, such as '$.add()', '$.before()', '$.after()', '$.addSelf()', etc.
- For details, please refer to the original jQuery Core 1.9 Upgrade Guide.
As of February 12, 2013, the latest version of jQuery is 1.9.1, but if you use existing jQuery plugins and libraries, it is expected that many things will not work as they are unless you set it to the version up to 1.8. It may be better to recognize jQuery up to 1.8 and after 1.9 as different things.