Is it possible to extend jQuery 1.3 to include the parseJSON function from 1.4.1+, and have it function the same way as it does in jQuery 1.4.1+? How would I go about that?
I have some sites where I have to use jQuery 1.3, but I have a tool that requires parseJSON, which was only introduced in jQuery 1.4.1. I vaguely know that I should be taking parseJSON from 1.4.1+ and trying to make it a plugin, but I don't know how to do that.
You could make it a plugin like this:
You can test it here.
This code's adopted from jQuery 1.4.4 - found here. After including the above with jQuery 1.3 as your question has, just use
$.parseJSON()as you normally would...or in your case, just include the plugins after the above code and$.parseJSON()will be present for them to use.