我是菜鸟,专门注册个账号问高手一个html转JS代码的问题。 1.asp输出方式将js代码以文本形式返回即可调用方式<script language="javascript" src="1.asp"></script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样???<body bgcolor="#ffffff" onload=initStyleElements()><!-- 第一步:把如下代码加入<body>区域中 --> <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++;if (i=1) alert("转换完成!");else alert("Page compiled "+i+" times!");}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><form method=post name=pad align=center><textarea rows=11 name=text cols=58 style="background-color:#EBEBEB;width:95%"><html><head><title>abcdef</title></head><body><a href="http://www.sina.com.cn">sina</a><a href="http://www.123.com" target="_blank">测试的</a></body></html></textarea><br><input type=button value=转换 name=compileIt onClick=generate() onMouseOver=LightOn(this) onMouseOut=LightOut(this)><input type=button value=选择 name=select onClick=selectCode() onMouseOver=LightOn(this) onMouseOut=LightOut(this)><input type=button value=显示 name=view onClick=preview() onMouseOver=LightOn(this) onMouseOut=LightOut(this)><input type=reset value=清除 name=clear onMouseOver=LightOn(this) onMouseOut=LightOut(this)></form><!-- 第二步:把如下代码加入<body>区域中 --></body> 二楼所说的我不明白,不好意思,我是菜鸟。三楼说的是手动转换的,我需要的是在1.asp页面自动完成转换。我希望知道的人能直接给我个代码,我刚注册没有分给大家,希望高手帮帮小弟。因为这个问题,我搞了三天了。 jqeury点击文本框变色,菜鸟询问各位大侠 求助 拼图小游戏 怎么实现点击一个按钮后让它消失? 关于同时运用两个美元符号问题 求教JQUERY插件机制 iframe的页面,如何使iframe里面多出的文字自动忽略? 问个问题! 蛙蛙请教:动态拼接表格问题 我对form不了解 JavaScript对文件进行MD5加密 如何才能让javascript发挥更大的作用? 这到底是那里出错了?(郁闷中)
<!-- 第一步:把如下代码加入<body>区域中 -->
<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++;
if (i=1) alert("转换完成!");
else alert("Page compiled "+i+" times!");
}
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>
<form method=post name=pad align=center>
<textarea rows=11 name=text cols=58 style="background-color:#EBEBEB;width:95%"><html>
<head>
<title>
abcdef
</title>
</head><body>
<a href="http://www.sina.com.cn">sina</a>
<a href="http://www.123.com" target="_blank">测试的</a>
</body>
</html></textarea><br>
<input type=button value=转换 name=compileIt onClick=generate() onMouseOver=LightOn(this) onMouseOut=LightOut(this)>
<input type=button value=选择 name=select onClick=selectCode() onMouseOver=LightOn(this) onMouseOut=LightOut(this)>
<input type=button value=显示 name=view onClick=preview() onMouseOver=LightOn(this) onMouseOut=LightOut(this)>
<input type=reset value=清除 name=clear onMouseOver=LightOn(this) onMouseOut=LightOut(this)>
</form>
<!-- 第二步:把如下代码加入<body>区域中 -->
</body>