87,996
社区成员




$.post("../xx.ashx",{
},function(response){
$("#div").html(response)
},"html");
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var HtmlUtil = {
HTML_CHARS : {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'/': '/',
'`': '`'
},
escapeHTML: function (html) {
return html.replace(/[&<>"'\/`]/g,
function (match) {
return HtmlUtil.HTML_CHARS[match];
});
}
}
window.onload = function() {
var s = '<table border=1><tr><td>aaaaa</td></tr></table>';
$("#d").html(HtmlUtil.escapeHTML(s));
}
</script>
</HEAD>
<BODY>
<div id="d"></div>
</BODY>
</HTML>