1.3.9

Back | Minified | Changelog | Cautionlog
2013-01-25

jQuery 1.9 Fix

The most major point of this release was fixing jQuery 1.9, which broke in one area when Sugar was included in the page. The cause was complex, on jQuery's side there was an issue that I submitted a pull request for, however the most direct culprit was String#namespace which is a method that never really fit into the library anyway. As a result I have removed this method from String entirely. At the moment I'm not sure if it will be re-added as it feels better for another lib.

Object.toQueryString

The inverse to Object.fromQueryString, this method will take an object and turn it into a query string for use in a url. In addition to the main method it is also mapped onto extended objects, making it even easier. Finally, a namespace can be added to scope all parameters by the given namespace.

var o1 = { foo: 'bar' }; var o2 = { foo: [1,2,3] }; Object.toQueryString(o1) // 'foo=bar' Object.toQueryString(o2) // 'foo[0]=1&foo[1]=2&foo[2]=3' Object.toQueryString(o2, 'bar') // 'bar[foo][0]=1&bar[foo][1]=2&foo[2]=3'
var o1 = Object.extended({ foo: 'bar' }); var o2 = Object.extended({ foo: [1,2,3] });
o1.toQueryString() // 'foo=bar' o2.toQueryString() // 'foo[0]=1&foo[1]=2&foo[2]=3' o2.toQueryString('bar') // 'bar[foo][0]=1&bar[foo][1]=2&foo[2]=3'

Other Minor Fixes