How to change ajax-charset?

前端 未结 4 2000
鱼传尺愫
鱼传尺愫 2020-12-03 11:09

How can I change the default encoding used by $.post()?

The arguments are encoded with UTF-8. How can I encode it with ISO 8859-1?

4条回答
  •  春和景丽
    2020-12-03 11:53

    It seems the charset cannot be changed anymore – $.ajax docs states:

    The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.

提交回复
热议问题