javascript ajax post words which contains & symbol and decode in php -
i m trying send ajax post contains '&'.
search.php?region=middle%20east%20&%20africa&city=&language=
but return 'middle east' in php side
please me
if using jquery:
$.ajax({ url: 'search.php', type: 'post', data: { region: 'middle east & africa', city: '', language: '' }, success: function(result) { // ... } });
if not manually url encode value using encodeuricomponent function:
var region = encodeuricomponent('middle east & africa'); // todo: send encoded value
Comments
Post a Comment