I want to send a string as an ajax Post parameter.
The following code:
$.ajax({ type: "POST", url: "http://nakolesah.ru/", data: 'foo=bar&ca$libri=no$libri', success: function(msg){ alert('wow'+msg); } });
Is not working. Why?
Try like this:
$.ajax({ type: 'POST', // make sure you respect the same origin policy with this url: // http://en.wikipedia.org/wiki/Same_origin_policy url: 'http://nakolesah.ru/', data: { 'foo': 'bar', 'ca$libri': 'no$libri' // <-- the $ sign in the parameter name seems unusual, I would avoid it }, success: function(msg){ alert('wow' + msg); } });
$.ajax({ type: 'POST', url:'http://nakolesah.ru/', data:'foo='+ bar+'&calibri='+ nolibri, success: function(msg){ alert('wow' + msg); } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With