str=str.replace(/&/g,"&");
str=str.replace(/</g,"<");
str=str.replace(/>/g,">");
str=str.replace(/</g,"<");
str=str.replace(/>/g,">");
解决方案 »
- js中如何从action中得到list和map,并遍历list和map,并把值给div中的table表格中
- js如何禁止浏览器y方向滚动
- 刚学html的菜鸟,求教如何写这个代码?
- jquery datagrid 绑定数据
- 如何改变框架页中 标签值
- IE WebBrowser打印预览 有的表格边线很粗,如何解决
- 如何找出相同的字符出来?谢谢
- 为什么是乱码??
- 可不可以把一个fream页面嵌入ifream中?并且怎样调用 最外面的父窗体 里面的javascript函数
- 请问如何用javascript禁止netscape6记忆用户名和密码
- 用javascript写的滚动新闻的问题?
- 很简单的问题,分还是比较高的,55分!!!!!!!!!!!!!!!!拜年了
str=str.replace(/&/g,"&");
str=str.replace(/</g,"<");
str=str.replace(/>/g,">");
str=str.replace(/\n/g,"<br>");
str=str.replace(/\"/g,""");
return str;
}
str = trim(str)
str = replace(str, ">", ">")
str = replace(str, "<", "<")
str = Replace(str, CHR(32), " ")
str = Replace(str, CHR(9), " ")
str = Replace(str, " ", " ")
str = Replace(str, CHR(34), """)
str = Replace(str, CHR(39), "'")
str = Replace(str, vbCr, "")
str = Replace(str, vbLf, "<BR>")
str = Replace(str, vbCrLf, "<BR>")
CheckStr = str
end function
用<xmp></xmp>按文本方式显示内容
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="Seagle.K">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<script language='javascript'>
function preview(str){
xxWin=window.open('','newwindow','height=450,width=550,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
xxWin.document.open("text/txt");
xxWin.document.write(str);
xxWin.document.close() ;
}var a = "<body><b><font color=red>\nhello world</font></b><table border=1><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table></body>";a = "<xmp>" + a + "</xmp>";
preview(a);
</script>
</body>
</html>