Use $. ajax () obtains the string from the backend php. Only loginSuccess or loginFaild characters are returned, and alert () and console are used. log () check is not wrong, but with firebug debugging, we can see that the return value character is followed by several rnrn characters, resulting in js judgment failure, such...
Use $. ajax () obtains the string from the backend php. Only loginSuccess or loginFaild characters are returned, and alert () and console are used. there is no error in log () check, but it can be seen through firebug debugging that the return value character is followed by several rnrn characters, leading to js judgment failure,
I searched the internet and some people encountered a similar situation. I tried jquery1.8 and 1.3 libraries, and these linefeeds will be added. I don't know if this is a jquery bug, or why?
Http://www.cnblogs.com/js-html/p/3384940.html
Reply content:
Use $. ajax () obtains the string from the backend php. Only loginSuccess or loginFaild characters are returned, and alert () and console are used. there is no error in log () check, but it can be seen through firebug debugging that the return value character is followed by several rnrn characters, leading to js judgment failure,
I searched the internet and some people encountered a similar situation. I tried jquery1.8 and 1.3 libraries, and these linefeeds will be added. I don't know if this is a jquery bug, or why?
Http://www.cnblogs.com/js-html/p/3384940.html
Check the php tag for any extra white space characters
Http://stackoverflow.com/questions/11593326/unwanted-new-line-returned-after-ajax-request
If such a character is received from the server, it should be because the server does not properly process the character to see if the corresponding php processing is too many characters.
The server returns the wrong data. I guess it is because?>
The Terminator breaks several carriage return lines to make the php code and html look nice. However, after the json string is output, the html line feed after the php end is output, we recommend that you do not end the Code if it is a pure php code!