JQuery – ajax call with dynamic parameters

This one was discovered because a colleague of mine asked me, and I started to wonder and realized I never used it before, never really needed it..But indeed, it can be quite handy!
Before you make the $.ajax call or $.post call or whatever, you do this:

Then, when you’re making the actual request, you pass your object on the data field

and voilá! you can build your parameters in a nice way, instead of “prop1=value1&prop2=value2”

Be back soon 🙂