The abnormal and uncommon parameter garbled problem occurs. When you click it, the webpage address with parameters is passed. Because the parameters I pass are Chinese characters, garbled characters are obtained at the backend. Unusual parameter garbled characters are encountered.
First, check the page.
, The monthly indicators also have the same three radio.
Under the three radio categories, there is an iframe. The effect is that different radio pages are displayed,
The webpage address with parameters is passed when you click.
(1) The problem arises. When "Daily indicator" and "monthly indicator" are switched, garbled characters are obtained in the background because the parameters I pass are Chinese characters,
Therefore, the parameter is encoded with encode, and the background UrlDecode is decoded. the depressing result is garbled.
Then, we carefully compare the page encoding and find that the page opened by iframe is not encoded.
Add the following sentence to the page:
The Code is as follows:
It seems that the "Daily indicator" and "monthly indicator" pages are displayed normally, and the parameters are passed.
(2) An abnormal problem occurred. when I switched to radio, an error was reported and the parameter changed to garbled characters.
I really don't know what went wrong this time. The "Daily indicator", "monthly indicator", and the JS method on the radio click switch page use the same one.
Depressed, confused, found as follows:
When you click "Coal Bed Methane", the page is normal. When you click "oil production", the parameter is incorrect. When the oil production is selected, click "Oil Production". The page is displayed normally.
I don't think so.
Then compare the "coal-bed methane" and "oil production", and I have hung up the official page of the "oil production" module. The "coal-bed methane" module is just a casual Baidu page. Due to the problem (1) encoding, the first thing I think about is encoding. Check Baidu encoding as follows,
The Code is as follows:
The encoding format is different. So I also hung the "Coal Bed Methane" Page and removed Baidu.
Yes. The page is running normally and no parameter garbled characters are reported.
Analyze the cause: It seems that the current iframe display page encoding is obtained when the parameter is passed, but it has nothing to do with the page encoding to be opened.
However, this is really not the case. It is an iframe. On the iframe parent page, I assign a url value to iframe and PASS Parameters to take care of the current page of iframe?