Home > front end >  Questions about the JQuery Post calls and Base64 encoding
Questions about the JQuery Post calls and Base64 encoding

Time:11-30

Hi everyone.

I met a mysterious mistake, language is Javascript and PHP,

This issue occurs only on baidu mobile browser, other mobile browsers and computer browsers don't have the problem,

Is the fact that the Javascript with JQuery Post call, visit the PHP script,

PHP will return a Json string:
{" errorCode ": 1," errorMsg ":" get sound success. ", "fileName" : "..//.. \/soundLibs \ 00000000 \/allPinyin \/bu4 wav ", "data" : "D \/jv + N \ \/iv/4 v + I \ \ \/z/dQDGANsA}
"
The data property within the string is "D/jv + N/4 v/iv + I//z/dQDGANsA"
This string, on baidu mobile browser, lead to the JQuery Post Http Status call returns 0, not 200.

Mystery is that the first letter strings are removed, or remove the tail letters, normal,
So can't go wrong trying to identify which characters,

Actually reason is like that, I need to put the two hexadecimal file base64_encode coding in PHP's and assign data property, to the Javascript,
Found that some files back to the Post is not successful,

You do not have what idea?
thank you
  • Related