首页 > 代码库 > MVC前后端数据被编码

MVC前后端数据被编码

@{
ViewBag.Title = "Home Page";
}
<script>
function htmldecode(s) {
console.log(s);
var div = document.createElement(‘div‘);
div.innerHTML = s;
return div.innerText || div.textContent;
}
@{
var data = "http://www.mamicode.com/

";
data = http://www.mamicode.com/data + ViewBag.Title;
data += "</div>";

}
var data=http://www.mamicode.com/‘@data‘ ;
console.log( htmldecode(data));


</script>

MVC前后端数据被编码