I have a javascript object that looks like...
filter = {
lastchanged: 5,
Location: {
Country: 5,
Province: 3
}
}
I'm making the ajax call like so...
jQuery.ajax({ url: search_url, data: filter, dataType: "html" })
I want the object properties to be serialized like so...
/my-controller?lastchanged=5&Location.Country=5&Location.Province=3
However they are currently serializing as...
/my-controller?lastchanged=5&Location%5BCountry%5D=5&Location%5BProvince%5D=3
which is not working with the MVC binding.
Is there a correct way to tell jQuery to encode the parameters the first way, exactly as they would be if it was a regular form submission?