This article mainly introduces the URL in the transfer of Chinese parameters through JS decoding, the need for friends can refer to the
If the parameter passed is: code as follows: <a href= "${pagecontext.request.contextpath}/productdisplay/productdisplay_ Productdisplayui.action?pkid=${pkid}&name=${name} "style=" Color:white; margin-top:10px; margin-bottom:10px; " >${name}</a> get the URL parameters of JS as follows: The code is as follows:/** initialization load end/function Geturlvars () {var vars = [], hash; var hashes = Window.location.href.slice (Window.location.href.indexOf ('? ') +1). Split (' & '); for (var i = 0; i < hashes.length i++) {hash = hashes[i].split (' = '); Vars.push (Hash[0]); Vars[hash[0]] = hash[1]; return vars; If there is Chinese in the URL, then the parameters will have Chinese garbled, you have to use decodeURI () method to decode, the following: The code is as follows://Get the category of pkid var params = Geturlvars (); Get the ID of this category var parentid = params[params[0]]; Get the category name var productName = decodeURI (params[params[1]);