Solution to the failure of page script assignment caused by carriage return on the string when parameters are passed through the url address. When parameters are accepted through the url address, the value of some parameters includes the carriage return % 0A. at this time, when the script is displayed on the page, the value V is paid to the script variable, script errors may occur when parameters are accepted through the url address. some parameter values include the carriage return '% 0a'. when the script is displayed on the page, paying this value V to the script variable may cause a script error.
Therefore, the corresponding: Some strings are url encoded at the beginning when the value is passed, and url decoding is performed when the script assigns values, so as to avoid the above problems.
In PHP, the URL encoding operation function is:Urlencode () and urldecode ()
The corresponding URL encoding operation function in js is:EncodeURI () and decodeURI ()
% 0a'. when the script is displayed on the page, the value V is paid to the script variable, which may cause a script error...