location.href中有中文字符时的解决方案

    xiaoxiao2021-03-25  98

    当简单的跳转到action时,可以用location.href进行,如果href中出现中文字符,即get请求中不可以有中文字符,需要进行解码

    encodeURI(encodeURI(keyvalue))进行编码,在服务器端URLDecoder.decode(keyvalue, "UTF-8")进行解码,问题解决!

    转载请注明原文地址: https://ju.6miu.com/read-19006.html

    最新回复(0)