So i am sending a JSON response from my controller as:
"date":["07%2F10%2F2013","07%2F16%2F2013","07%2F25%2F2013"]
The dates are being encoded on PHP using urlencode($date);
On my jquery response i read it this way:
var dates = "+this.date+";
dates = decodeURIComponent(dates);
var unavailableDates = dates.split(',');
And when printed with console.log i get (using firebug to debug):
["07/10/2013", "07/16/2013", "07/25/2013"]
Now I do it this way:
var dates = '07%2F10%2F2013,07%2F16%2F2013,07%2F25%2F2013';
dates = decodeURIComponent(dates);
var unavailableDates = dates.split(',');
Get the exact same result:
["07/10/2013", "07/16/2013", "07/25/2013"]
But when trying to use it on the jquery datepicker as part of dates that are not available only the bottom portion of code works. Anyone knows why?