如何制作自己的在线代码测试器酷 在线代码测试器

首先将下面的代码稍作修改后粘贴到在桌面右击新建文档记事本另存为“xxx.html”(网页的形式)上传到网络空间,得到你上传的网址代码如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0Transitional//EN">
<!-- saved fromurl=(0053)http://virtualhost.webplus.com.cn/542011495/daima.htm-->
<HTML>
<HEAD>
<TITLE>麦迪天神-在线代码测试器</TITLE>
<META http-equiv=Content-Type content="text/html;charset=gb2312">
<SCRIPT language=JavaScript>
var SelRGB = '';
var DrRGB = '';
var SelGRAY = '120';

var hexch = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8','9', 'A', 'B', 'C', 'D', 'E', 'F');

function ToHex(n)
{var h, l;

n = Math.round(n);
l = n % 16;
h = Math.floor((n / 16)) % 16;
return (hexch[h] + hexch[l]);
}

function DoColor(c, l)
{ var r, g, b;

r = '0x' + c.substring(1, 3);
g = '0x' + c.substring(3, 5);
b = '0x' + c.substring(5, 7);

if(l > 120)
{
l = l -120;

r = (r *(120 - l) + 255 * l) / 120;
g = (g *(120 - l) + 255 * l) / 120;
b = (b *(120 - l) + 255 * l) / 120;
}else
{
r = (r * l)/ 120;
g = (g * l)/ 120;
b = (b * l)/ 120;
}

return '#' + ToHex(r) + ToHex(g) +ToHex(b);
}

function EndColor()
{ var i;

if(DrRGB != SelRGB)
{
DrRGB =SelRGB;
for(i = 0; i<= 30; i ++)
GrayTable.rows(i).bgColor = DoColor(SelRGB, 240 - i * 8);
}

SelColor.value = DoColor(RGB.innerText,GRAY.innerText);
ShowColor.bgColor = SelColor.value;
}
</SCRIPT>
<SCRIPT language=JavaScript event=onclickfor=ColorTable>
SelRGB = event.srcElement.bgColor;
EndColor();
</SCRIPT>
<SCRIPT language=JavaScript event=onmouseoverfor=ColorTable>
RGB.innerText = event.srcElement.bgColor;
EndColor();
</SCRIPT>
<SCRIPT language=JavaScript event=onmouseoutfor=ColorTable>
RGB.innerText = SelRGB;
EndColor();
</SCRIPT>
<SCRIPT language=JavaScript event=onclickfor=GrayTable>
SelGRAY = event.srcElement.title;
EndColor();
</SCRIPT>
<SCRIPT language=JavaScript event=onmouseoverfor=GrayTable>
GRAY.innerText = event.srcElement.title;
EndColor();
</SCRIPT>
<SCRIPT language=JavaScript event=onmouseoutfor=GrayTable>
GRAY.innerText = SelGRAY;
EndColor();
</SCRIPT>
<SCRIPT language=JavaScript event=onclickfor=Ok>
如何制作自己的在线代码测试器[酷] 在线代码测试器
window.returnValue = SelColor.value;
window.close();
</SCRIPT>
<META content="MSHTML 6.00.2900.2802"name=GENERATOR></HEAD>
<BODY bgColor=#dbe4f4>
<CENTER><B><FONT color=#000000size=3>麦迪天神在线代码测试器</FONT></B><BR><BR>
<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_r(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.getElementByIdx)x=document.getElementByIdx(n); return x;
}
//-->
</SCRIPT>
<TEXTAREA name=js_1 id=code rows=20cols=80>欢迎使用麦迪天神在线代码测试器!
本代码测试器由麦迪天神编辑制作,用于预先
测试查看代码所显示的效果,希望能给您带来方便!
请将代码复制到这里,然后点“运行代码”。
</TEXTAREA> <BR>
<SCRIPT>
functionrunEx(){
var winEx = window.open("", "winEx","width=700,height=530,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
winEx.document.write("<title>"+document.title+"</title>"+document.all.code.value);
winEx.document.close();
}
</SCRIPT>
<INPUT onclick=runEx() type=button value=运行代码name=Button> <INPUT name=Buttononclick="JM_cc('js_1')" type=buttonvalue=复制到剪贴板> <INPUT onclick="code.value=''"type=button value=清空代码 name=Button><script>
<!--
function winopen(){
var targeturl="
http://fs9.139.com/2/2002/andydau/share/2006829215727277.htm"
newwin=window.open("","","scrollbars")
if (document.all){
newwin.moveTo(0,0)
newwin.resizeTo(screen.width,screen.height)
}
newwin.location=targeturl
}
//-->
</script> <input type="button"onClick="winopen()" value="在新窗口中打开"name="button"> <INPUTonclick="parent.location='http://blog.sina.com.cn/m/binghe2008'"type=button value=返回主页name=Button><BR><BR><FONT color=#ff3333size=2>小贴士</FONT></FONT><FONT face=arial
color=#000000 size=3>:</FONT><FONT color=#ff3333size=2>可以在线修改代码</FONT><FONT
face=arial color=#000000 size=3>,</FONT><FONTcolor=#ff3333
size=2>如颜色</FONT><FONT face=arial color=#000000size=3>,</FONT><FONT
color=#ff3333 size=2>大小等等</FONT><FONT face=arialcolor=#000000
size=3>,</FONT><FONT color=#ff3333size=2>直到自已的满意的效果</FONT><FONTface=arial
color=#000000 size=3>,</FONT><FONT color=#ff3333size=2>再使用</FONT><FONT
face=arial color=#000000size=3>!<BR>(size=</FONT><FONTcolor=#ff3333
size=2>表示大小</FONT><FONT face=arial color=#000000size=3>,color=</FONT><FONT
color=#ff3333 size=2>表示颜色</FONT><FONT face=arialcolor=#000000
size=3>,</FONT><FONT color=#000000size=2>颜色代码可以使用</FONT><FONT face=arial
color=#000000 size=3>:</FONT><A
href="
http://bbfc.cn/color.htm"target=_blank><FONT color=#ff3333
size=2>颜色代码参照表</FONT></A><FONT face=arialcolor=#000000 size=3><FONT
color=#ff3333size=2></FONT>)<BR><BR>[</FONT><FONTcolor=#000000
size=3>麦迪天神的BLOG</FONT><FONT face=arialcolor=#000000 size=3>]<BR>
<P></FONT><FONT color=#000000size=3>博客地址</FONT><FONT face=arialcolor=#000000
size=3>:<B><A
href="
http://blog.sina.com.cn/u/1251200234"target=_blank><fontcolor=#990033>http://blog.sina.com.cn/m/binghe2008</font></A></B></FONT>
</CENTER></P></BODY>
</HTML>
采用如下代码进行调用:<DIV>
<TABLE class=description cellSpacing=0 cellPadding=0align=center border=0>
<TBODY>
<TR>
<TD align=middle>
<DIV id=articleText4723cdbf010005qbalign=left>
<P align=center><IFRAME marginWidth=0 marginHeight=0src="上传得到的网址" frameBorder=0width=600 scrolling=noheight=500></IFRAME></P></DIV></TD></TR></TBODY></TABLE></DIV>
调用代码的添加方法:{注:可以添加到面板中,也可以添加到文章中}1,控制面板----首页内容维护----定义空白模板----新建,创建模块标题,粘贴代码(粘贴代码前,在普通模式下打一个空格,然后再进入源代码编辑模式,这时你会看到源代码中已经有一行代码了(<DIV>&nbsp;</DIV>),这时你再将自己的代码粘贴到它的下面即可,因为CSS代码粘贴到新建立的模块中,没有别的内容,不会显示的)----保存并返回;

 2,控制面板----定制我的首页----点添加模块----点选创建好的模块标题---勾上并保存,移动新建面板位置--保存设置。做第二步的目的是将建立好的模块在博客个人首页里呈现出来。

预览效果:

  

爱华网本文地址 » http://www.aihuau.com/a/25101011/53795.html

更多阅读

如何拥有自己的个性邮箱 如何让邮箱有个性签名

如何拥有自己的个性邮箱——简介主流邮箱的个性域名都被抢光了?非主流邮箱用着又没安全保障?不要紧,今天我来教大家拥有属于自己的邮箱,安全,高端,大气,上档次。如何拥有自己的个性邮箱——方法/步骤如何拥有自己的个性邮箱 1、首先在万网

Discuz如何还原自己的数据库 discuz修改数据库密码

Discuz如何还原自己的数据库——简介Discuz如何还原自己的数据库,接下来就让我给大家讲解一下吧Discuz如何还原自己的数据库——方法/步骤Discuz如何还原自己的数据库 1、进入后台,点击“站长”--“数据库”--“恢复”,如图:

怎样制作自己的游戏视频 游戏视频后期制作软件

看到网上很多人做出自己的视频,其实视频很容易制作怎样制作自己的游戏视频——工具/原料fraps格式工厂怎样制作自己的游戏视频——步骤/方法怎样制作自己的游戏视频 1、首先进入FRAPS设置好快捷键怎样制作自己的游戏视频 2、进入游

护肤小知识:如何判断自己的肤质

人的皮肤大体上可以分为干性、中性、油性、混合型和敏感型。看看各种肤质有什么特点,小编教各位MM怎样判断自己的肤质,让你的美容护肤小知识越来越强大。护肤小知识:如何判断自己的肤质——步骤/方法护肤小知识:如何判断自己的肤质 1、

如何找回自己的魔兽世界帐号的密码 魔兽世界战网密码找回

如何找回自己的魔兽世界帐号的密码——简介如何快速的找回自己的魔兽帐号的密码呢?其实很简单,只需要在魔兽世界的官方网站进行相应操作即可,但是需要自己记得帐号的邮箱,以便完成整个的操作。如何找回自己的魔兽世界帐号的密码——工

声明:《如何制作自己的在线代码测试器酷 在线代码测试器》为网友演绎新秀分享!如侵犯到您的合法权益请联系我们删除