uksz uksz - 2 years ago 120
Javascript Question

JQuery param escaping & sign

I have the following object:

var ob = {
prop: 'ab&cs&ef'

When I use param method from jQuery ($.param()), it returns:


How can I make it return the following?



I know, that if I use:


I will receive what I need. However, unescape method is deprecated.

Answer Source

You have to decode the URI coded result again p.e. like this:

var ob = {
  prop: 'ab&cs&ef'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download