我想通过 ajax 发送 base64 字符串我通过 JavaScript 函数转义对其进行编码
data = escape"data:image/png;base64,iVBOR w0K+GgoAAAAN+SUhEUgAAAU oAA+ADmCAYAAAC+zgMwkAAAgAElEQ+VR4Xu1de3BVx3n");
它工作正常并将其编码为
data%3Aimage/png%3Bbase64%2CiVBOR%20w0K+GgoAAAAN+SUhEUgAAAU%20oAA+ADmCAYAAAC+zgMwkAAAgAElEQ+VR4Xu1de3BVx3n
但是当我通过ajax发送它时
$.ajax({
url: 'http://fiveriverstech.com',
type: 'POST',
data: "data="+data,
success: function(response){
console.log(response)
}
});
+
它将白色空格的标志替换为data:data:image/png;base64,iVBOR w0K GgoAAAAN SUhEUgAAAU oAA ADmCAYAAAC zgMwkAAAgAElEQ VR4Xu1de3BVx3n
我怎样才能防止这样做