jQuery send string as POST parameters jQuery send string as POST parameters ajax ajax

jQuery send string as POST parameters


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);    }});


I see that they did not understand your question.

Answer is: add "traditional" parameter to your ajax call like this:

$.ajax({  traditional: true,  type: "POST",  url: url,  data: custom,  success: ok,  dataType: "json"});

And it will work with parameters PASSED AS A STRING.