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