Problem Description: Submit data from the page to the background (non-AJAX submissions), when checking the legitimacy of the data, if there is an error, through the Echo out a section of JS code, error prompts. As follows
echo "";
The popup box will appear garbled.
Problem Analysis: If the browser is set to automatically detect the encoding, there will be no garbled, otherwise, garbled situation may occur. Because the script tag in the JS code is bare-Ben, no coding restrictions, so there will be garbled situation.
Problem solving: Wrap a layer of HTML code outside of the pop-up error message. As follows
$output =<<
<>
Eof;echo $output;
This way, when the error message pops up, there will be no more garbled cases.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above is introduced in PHP using JS pop-up error message garbled, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.