javascript中怎么用包含html标记的变量。 在ASP中用:<%=server.HTMLEncode(string)%>转化的非执行脚本 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 无关,你问题问清楚些。只有把这些包含的值放进去了才会有关。你要想当文本显示,例如 <等等dreamweaver中看去 str="<body><table><tr>"document.write(str.replace(/</g,"<")); <META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK href="/fav.ico" rel="shortcut icon"><SCRIPT language=JavaScript> <!-- function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); } function JM_cc(ob){ var obj=MM_findObj(ob); if (obj) { obj.select();js=obj.createTextRange();js.execCommand("Copy");} } function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x; } //--> </SCRIPT><META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD><BODY id=all text=#000000 bgColor=#336699><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="/images/sq_1.gif" width=11 height="14"></TD> <TD width="100%"></TD> <TD><IMG src="/images/sq_2.gif" width=11 height="14"></TD> </TR></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="/images/space.gif" width=11 height="1"></TD> <TD width="100%"> <table width="100%" border="0" cellpadding="8"> <tr> <td align="center"> <script language="JavaScript"> document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>"); </script> </td> </tr> <tr> <td bgcolor="#f7f7f7"><!-- #BeginEditable "example" --><font face="Verdana">提示:</font> 把你想加密的文档的源代码拷贝到下面的文本框内,按下生成按钮就可以得到一段加密了的页面代码,把代码复制到新的页面就可以了. [注意:可重复加密啊!] <script language=JavaScript> var i=0; var ie=(document.all)?1:0; var ns=(document.layers)?1:0; function initStyleElements() /* Styles for Buttons Init */ { var c = document.pad; if (ie) { //c.text.style.backgroundColor="#DDDDDD"; c.compileIt.style.backgroundColor="#C0C0A8"; c.compileIt.style.cursor="hand"; c.select.style.backgroundColor="#C0C0A8"; c.select.style.cursor="hand"; c.view.style.backgroundColor="#C0C0A8"; c.view.style.cursor="hand"; c.retur.style.backgroundColor="#C0C0A8"; c.retur.style.cursor="hand"; c.clear.style.backgroundColor="#C0C0A8"; c.clear.style.cursor="hand"; } else return; } /* Buttons Enlightment of "Compilation" panel */ function LightOn(what) { if (ie) what.style.backgroundColor = '#E0E0D0'; else return; } function FocusOn(what) { if (ie) what.style.backgroundColor = '#EBEBEB'; else return; } function LightOut(what) { if (ie) what.style.backgroundColor = '#C0C0A8'; else return; } function FocusOff(what) { if (ie) what.style.backgroundColor = '#DDDDDD'; else return; } /* Buttons Enlightment of "Compilation" panel */ function generate() /* Generation of "Compilation" */ { code = document.pad.text.value; if (code) { document.pad.text.value='正在生成加密代码,请稍后!'; setTimeout("compile()",1000); } else alert('请输入源文件代码') } function compile() /* The "Compilation" */ { document.pad.text.value=''; compilation=escape(code); document.pad.text.value="<script>\n<!--\ndocument.write(unescape(\""+compilation+"\"));\n//-->\n<\/script>"; i++; alert("页面被加密了 "+i+" 次!"); } function selectCode() /* Selecting "Compilation" for Copying */ { if(document.pad.text.value.length>0) { document.pad.text.focus(); document.pad.text.select(); } else alert('没有可以选择的文本内容!') } function preview() /* Preview for the "Compilation" */ { if(document.pad.text.value.length>0) { pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,height=320,left=50,top=110"); pr.document.write(document.pad.text.value); } else alert('没有可以预浏览的文本内容!') } function uncompile() /* Decompiling a "Compilation" */ { if (document.pad.text.value.length>0) { source=unescape(document.pad.text.value); document.pad.text.value=""+source+""; } else alert('你需要生成被加密的代码后才能取回源代码!') } // --> </script> <table cellspacing=0 cellpadding=0 width="100%" border=0> <tbody> <tr> <td width="100%" bgcolor="#feead8"> <form name=pad method=post align="center"> <textarea style="WIDTH: 100%; BACKGROUND-COLOR: #ebebeb" name=text rows=21 cols=58></textarea> <br> <input onMouseOver=LightOn(this) onClick=generate() onMouseOut=LightOut(this) type=button value=加密代码 name=compileIt> <input onMouseOver=LightOn(this) onClick=selectCode() onMouseOut=LightOut(this) type=button value=全选代码 name=select> <input onMouseOver=LightOn(this) onClick=preview() onMouseOut=LightOut(this) type=button value=预浏览页面 name=view> <input onMouseOver=LightOn(this) onClick=uncompile() onMouseOut=LightOut(this) type=button value=原代码 name=retur> <input onMouseOver=LightOn(this) onMouseOut=LightOut(this) type=reset value=清空 name=clear> </form> </td> </tr> </tbody> </table> <!-- #EndEditable --></td> </tr> <tr> <td><!-- #BeginEditable "code" --><br> <form name="form1" method="post" action=""> </form> <!-- #EndEditable --></td> </tr> </table> </TD> <TD><IMG src="/images/space.gif" width=11 height="1"></TD> </TR></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="/images/sq_3.gif" width=11 height="14"></TD> <TD width="100%"></TD> <TD><IMG src="/images/sq_4.gif" width=11 height="14"></TD> </TR></TABLE></BODY><!-- #EndTemplate --> </HTML> 什么叫宿主对象 一个学文的提问:用浏览器上的word按钮打开当前网页上的内容。感谢老师。 求Java混淆加密JavaScript的代码 javaScript 悬停浮动层定位 请大大们帮我修改下我这个JS收缩展开层的代码 求助,帮忙改下图片播放的代码 javascript如何得到URL的中的参数和值? 菜鸟请教:如何点击一个链接使当前单元格背景换个图片? 一个非常简单的问题,简单到聪明的人经常会弄错…………… 可否在客户端用JS修改某个文件的缓存参数呢? file 类型对象,他的value值怎样修改 javascript中如何判断是润年由此方法吗?
文本显示,例如 <等等dreamweaver中看去
document.write(str.replace(/</g,"<"));
<LINK href="/fav.ico" rel="shortcut icon">
<SCRIPT language=JavaScript>
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function JM_cc(ob){
var obj=MM_findObj(ob); if (obj) {
obj.select();js=obj.createTextRange();js.execCommand("Copy");}
} function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
//-->
</SCRIPT>
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
</HEAD>
<BODY id=all text=#000000 bgColor=#336699>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR bgColor=#ffffff>
<TD><IMG src="/images/sq_1.gif" width=11 height="14"></TD>
<TD width="100%"></TD>
<TD><IMG src="/images/sq_2.gif"
width=11 height="14"></TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR bgColor=#ffffff>
<TD><IMG src="/images/space.gif" width=11 height="1"></TD>
<TD width="100%">
<table width="100%" border="0" cellpadding="8">
<tr>
<td align="center">
<script language="JavaScript">
document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>");
</script>
</td>
</tr>
<tr>
<td bgcolor="#f7f7f7"><!-- #BeginEditable "example" --><font face="Verdana">提示:</font>
把你想加密的文档的源代码拷贝到下面的文本框内,按下生成按钮就可以得到一段加密了的页面代码,把代码复制到新的页面就可以了. [注意:可重复加密啊!]
<script language=JavaScript>
var i=0;
var ie=(document.all)?1:0;
var ns=(document.layers)?1:0; function initStyleElements() /* Styles for Buttons Init */
{
var c = document.pad;
if (ie)
{
//c.text.style.backgroundColor="#DDDDDD";
c.compileIt.style.backgroundColor="#C0C0A8";
c.compileIt.style.cursor="hand";
c.select.style.backgroundColor="#C0C0A8";
c.select.style.cursor="hand";
c.view.style.backgroundColor="#C0C0A8";
c.view.style.cursor="hand";
c.retur.style.backgroundColor="#C0C0A8";
c.retur.style.cursor="hand";
c.clear.style.backgroundColor="#C0C0A8";
c.clear.style.cursor="hand";
}
else return;
} /* Buttons Enlightment of "Compilation" panel */
function LightOn(what)
{
if (ie) what.style.backgroundColor = '#E0E0D0';
else return;
}
function FocusOn(what)
{
if (ie) what.style.backgroundColor = '#EBEBEB';
else return;
}
function LightOut(what)
{
if (ie) what.style.backgroundColor = '#C0C0A8';
else return;
}
function FocusOff(what)
{
if (ie) what.style.backgroundColor = '#DDDDDD';
else return;
}
/* Buttons Enlightment of "Compilation" panel */ function generate() /* Generation of "Compilation" */
{
code = document.pad.text.value;
if (code)
{
document.pad.text.value='正在生成加密代码,请稍后!';
setTimeout("compile()",1000);
}
else alert('请输入源文件代码')
}
function compile() /* The "Compilation" */
{
document.pad.text.value='';
compilation=escape(code);
document.pad.text.value="<script>\n<!--\ndocument.write(unescape(\""+compilation+"\"));\n//-->\n<\/script>";
i++;
alert("页面被加密了 "+i+" 次!");
}
function selectCode() /* Selecting "Compilation" for Copying */
{
if(document.pad.text.value.length>0)
{
document.pad.text.focus();
document.pad.text.select();
}
else alert('没有可以选择的文本内容!')
}
function preview() /* Preview for the "Compilation" */
{
if(document.pad.text.value.length>0)
{
pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,height=320,left=50,top=110");
pr.document.write(document.pad.text.value);
}
else alert('没有可以预浏览的文本内容!')
}
function uncompile() /* Decompiling a "Compilation" */
{
if (document.pad.text.value.length>0)
{
source=unescape(document.pad.text.value);
document.pad.text.value=""+source+"";
}
else alert('你需要生成被加密的代码后才能取回源代码!')
}
// -->
</script>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td width="100%" bgcolor="#feead8">
<form name=pad method=post align="center">
<textarea style="WIDTH: 100%; BACKGROUND-COLOR: #ebebeb" name=text rows=21 cols=58></textarea>
<br>
<input onMouseOver=LightOn(this) onClick=generate() onMouseOut=LightOut(this) type=button value=加密代码 name=compileIt>
<input onMouseOver=LightOn(this) onClick=selectCode() onMouseOut=LightOut(this) type=button value=全选代码 name=select>
<input onMouseOver=LightOn(this) onClick=preview() onMouseOut=LightOut(this) type=button value=预浏览页面 name=view>
<input onMouseOver=LightOn(this) onClick=uncompile() onMouseOut=LightOut(this) type=button value=原代码 name=retur>
<input onMouseOver=LightOn(this) onMouseOut=LightOut(this) type=reset value=清空 name=clear>
</form>
</td>
</tr>
</tbody>
</table>
<!-- #EndEditable --></td>
</tr>
<tr>
<td><!-- #BeginEditable "code" --><br>
<form name="form1" method="post" action="">
</form>
<!-- #EndEditable --></td>
</tr>
</table>
</TD>
<TD><IMG src="/images/space.gif"
width=11 height="1"></TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR bgColor=#ffffff>
<TD><IMG src="/images/sq_3.gif" width=11 height="14"></TD>
<TD width="100%"></TD>
<TD><IMG src="/images/sq_4.gif"
width=11 height="14"></TD>
</TR>
</TABLE>
</BODY>
<!-- #EndTemplate -->
</HTML>