對textarea框的代碼調(diào)試,而且功能上使用非常方便,酷
<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>對textarea框的代碼調(diào)試,而且功能上使用非常方便,酷</TITLE>
</HEAD>
<BODY >
<SCRIPT>function JM_cc(ob){
ob.select();js=ob.createTextRange();js.execCommand("Copy");
}</SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
<TBODY>
<TR>
<TD align=middle width="100%">代碼說明</TD></TR>
<TR>
<TD align=middle width="100%"></TD></TR></TBODY></TABLE>
<FORM action=--WEBBOT-SELF---------------- method=post>
<DIV align=center>
<CENTER><TEXTAREA name=txt rows=20 cols=65></TEXTAREA></CENTER><BR></DIV>
<CENTER><TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR bgColor=#f0fff0>
<TD align=middle width="17%"><FONT color=#004080><INPUT onclick=javascript:this.form.txt.focus();this.form.txt.select(); type=button value="代 碼 全 選"></FONT></TD>
<TD align=middle width="17%"><INPUT onclick="window.open('view-source:file:///C:/windows/autoexec.bat','_self')" type=button value=使用記事本></TD>
<TD align=middle width="20%"><FONT color=#004080><INPUT id=flashit onclick=test() type=button value=調(diào)試運(yùn)行本代碼 name=tryit></FONT></TD>
<TD align=middle width="21%"><FONT color=#004080><INPUT onclick=JM_cc(txt) type=button value=直接復(fù)制到剪貼板></FONT></TD>
</TR>
</TBODY></TABLE>
<TABLE width="100%">
<DIV align=center>
<CENTER></DIV>
<TBODY></TBODY></TABLE></CENTER>
<SCRIPT language=JavaScript1.2>
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;}
function test(){
obj=MM_findObj('txt');
if (obj.value.length<1) {alert("請輸入代碼后按運(yùn)行!");obj.focus();}
else{
var winEx = window.open("", "winEx", "width=400,height=400,status=yes,menubar=yes,scrollbars=yes,resizable=yes"); winEx.document.open("text/html", "replace");
winEx.document.write(obj.value);
winEx.document.close();}}
if (document.all&&document.all.flashit){
var flashelement=document.all.flashit
if (flashelement.length==null)
flashelement[0]=document.all.flashit
function changecolor(which){
if (flashelement[which].style.color=='')
flashelement[which].style.color="#FF8040"
else
flashelement[which].style.color=""}
if (flashelement.length==null)
setInterval("changecolor(0)",1000)
else
for (i=0;i<flashelement.length;i++){
var tempvariable='setInterval("changecolor('+i+')",'+'1000)'
eval(tempvariable)}}
</SCRIPT>
</BODY></HTML>
相關(guān)文章
js刪除select中重復(fù)項的實(shí)現(xiàn)代碼
使用嵌套循環(huán)來枚舉重復(fù)項,然后移除。2010-02-02javascript實(shí)現(xiàn)上傳圖片前的預(yù)覽(TX的面試題)
javascript實(shí)現(xiàn)上傳圖片前的預(yù)覽(TX的面試題)...2007-08-08當(dāng)文本框的值發(fā)生改變時,觸發(fā)事件,在IE中有效
當(dāng)文本框的值發(fā)生改變時,觸發(fā)事件,在IE中有效,具體的大家可以測試下。2009-09-09