我想发送一个字符串作为ajax Post参数。
如下代码:
$.ajax({ type: "POST", url: "http://nakolesah.ru/", data: 'foo=bar&ca$libri=no$libri', success: function(msg){ alert('wow'+msg); } });
不管用。为什么?
尝试这样:
$.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); } });