The content returned by ajax actually automatically adds the pre tag. The solution is to modify the return type of the general handler. If you encounter a similar situation, you can refer to the following
ajax returns, automatically adds the pre tag
The content returned by ajax actually automatically adds the
tagIn FF, IE, and Google Chrome, each return is different: ff lowercase, IE uppercase, Google plus style
After checking, it turns out that the returned type is wrong.
Final solution, modify the return type of the general handler
Modify
context.Response.ContentType = "text/plain";
to
context.Response.ContentType = "text/html";
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
Detailed explanation of Ajax and form iframe methods to implement file upload
A brief analysis of the clever use of Ajax beforeSend Improve user experience
Quick solution for ajax transmission parameters containing special characters
The above is the detailed content of Solution to automatically add pre tag to ajax return value. For more information, please follow other related articles on the PHP Chinese website!