开发者

jQuery AJAX Post - encoding

I am posting form from page in UTF-8 to page in Win-1250. I have problem with chars encoding.

$.开发者_如何学JAVAajax({
    type: 'POST',
    url: $(this).attr('action'),
    data: $(this).serializeArray()
});


At server - side script you can use something like that:

$res = array();
foreach($_POST as $p)
{
    array_push($res,iconv('UTF-8','Windows-1250',$p));
}

$res - is encoded array

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜