When you create a website, a page transmits values to another page through the address. After receiving the page value, you need to convert the data into a JSON object.
Because jquery is used, a method in jquery is used at the beginning.
VaR info = jquery. parsejson (Request ("info "));
In ie, the webpage runs normally, but in Firefox and Google browsers, errors may occur.
I had to use the js method. I tried two methods:
1: var info = eval ("(" + decodeuricomponent (Request ("info") + "); // note that the decodeuricomponent () method is required for encoding and conversion. 2: vaR info = (new function ("", "Return" + decodeuricomponent (Request ("info") (); // fewer and fewer people use this method, // note that the decodeuricomponent () method is also required for encoding conversion.
Note:
The decodeuricomponent () function can decode the uri of the encodeuricomponent () function.
<SCRIPT type = "text/JavaScript"> var test1 = "http://www.w3school.com.cn/My first/" document. write (encodeuricomponent (test1) + "<br/>") document. write (decodeuricomponent (test1) </SCRIPT>
Output:
HTTP % 3A % 2f % 2fwww.w3school.com.cn % 2fmy % 20 first % 2 fhttp: // www.w3school.com.cn/my first/