First look at the example
Copy Code code as follows:
function WebChart () {
var t = document.getElementById ("txtreceive");
if (T.value = null | | t.value = = "") {
Alert ("Please inquire first");
}
else {
alert (T.value);
document.getElementById ("Center-iframe"). src = "map/industrymap.aspx?_indeustry=" + t.value;
}}
This time alert comes out of the code is very normal, are Chinese characters.
But it's garbled when you get it in the background.
Copy Code code as follows:
protected void Page_Load (object sender, EventArgs e)
{
Industry = request.querystring["_indeustry"]. ToString ();
Initmap ();
Getshowmuilt ();
}
Web.config has been configured for UTF-8, but not yet.
Copy Code code as follows:
<system.web>
<globalization culture= "en-en" and "uiculture=" requestencoding= "UTF-8"
responseencoding= "UTF-8" fileencoding= "UTF-8"/>
</system.web>
Final Solution
Copy Code code as follows:
function WebChart () {
var t = document.getElementById ("txtreceive");
if (T.value = null | | t.value = = "") {
Alert ("Please inquire first");
}
else {
var url = encodeURI ("map/industrymap.aspx?_indeustry=" + t.value);
alert (URL);
document.getElementById ("Center-iframe"). src = URL;
}
}