I’m having an issue with posting data to my php script with ajax.
Firebug says:
SyntaxError: missing ) after argument list
[Break On This Error]
com&enquiry=http%3A%2F%2Fwww.youtube.com.au%0A%0AIt%20doesn't%20work..it's')
v2.js (line 1, col 60)
my JavaScripts are:
var g="name="+q.val()+"&phone="+k.val()+"&email="+l.val()+"&enquiry="+encodeURIComponent(i.val())
jQuery.ajax({type:"POST",url:"mail.php",data:g,cache:false,success:function(b){}})
enquiry is from a textarea and posted message is:
It doesn’t work..it’s
Try like this:
This way jQuery will take care of properly url encoding all your parameters.