能看的av_午夜黄色av_在线观看国产视频_天天爱综合_国产精品亚洲成在人线_日韩一

訂閱本欄目 RSS您所在的位置: 深山工作室 > HTML > 正文

一個運行HTML文件的代碼

網(wǎng)頁教學(xué)網(wǎng) 2008/3/19 20:40:55 深山行者 字體: 瀏覽 8751

以下是引用片段:

<style type="text/css">
<!--
.sumit1 {width:98%;height:100%;background:#FFFFFF;border:1px solid red;color:red;font-weight:bold;font-size:14px;}
.sumit2 {width:98%;height:100%;background:#FFFFFF;border:1px solid green;color:green;font-weight:bold;font-size:14px;}
.sumit3 {width:98%;height:100%;background:#FFFFFF;border:1px solid blue;color:blue;font-weight:bold;font-size:14px;}
.sumit4 {width:98%;height:100%;background:#FFFFFF;border:1px solid #000;color:#000;font-weight:bold;font-size:14px;}
.sumit5 {width:98%;height:100%;background:#FFFFFF;border:1px solid blue;color:blue;font-weight:bold;font-size:14px;}
.sumit6 {width:98%;height:100%;background:#FFFFFF;border:1px solid #000;color:#000;font-weight:bold;font-size:14px;}
-->
</style>
<script>
//獲取一個對象
function getByid(id) {
 if (document.getElementById) {
  return document.getElementById(id);
 } else if (document.all) {
  return document.all[id];
 } else if (document.layers) {
  return document.layers[id];
 } else {
  return null;
 }
}


//運行框操作
function creatID(DivID){
var objs=getByid(DivID).getElementsByTagName('textarea');
var inps=getByid(DivID).getElementsByTagName('input');
var buts=getByid(DivID).getElementsByTagName('button');
var labs=getByid(DivID).getElementsByTagName('label');
 for (i=0; i<objs.length; i++) {
  objs[i].id="runcode"+i;
  inps[i].id=i
  buts[i].id=i
  labs[i].id=i
 }
}
function runCode(obj){  //定義一個運行代碼的函數(shù),
   var code=getByid("runcode"+obj).value;//即要運行的代碼。
   var newwin=window.open('','','');  //打開一個窗口并賦給變量newwin。
   newwin.opener = null // 防止代碼對論談頁面修改
   newwin.document.write(code);  //向這個打開的窗口中寫入代碼code,這樣就實現(xiàn)了運行代碼功能。
   newwin.document.close();
}

//復(fù)制代碼
function doCopy(obj) {
 if (document.all){
   textRange = getByid("runcode"+obj).createTextRange();
   textRange.execCommand("Copy");
   alert("代碼已經(jīng)復(fù)制到剪切板");
 }else{
   alert("此功能只能在IE上有效\n\n請在文本域中用Ctrl+A選擇再復(fù)制")
 }
}
//另存代碼
function saveCode(obj) {
        var winname = window.open('','','width=0,height=0,top=200,left=200px');
        winname.document.open('text/html', 'replace');
        winname.document.write(obj.value);
        winname.document.execCommand('saveas','','純CSS簡潔TAB.html');
        winname.close();
}

//剪切代碼
function cut(obj) {
 if (document.all){
   textRange = getByid("runcode"+obj).createTextRange();
   textRange.execCommand("cut");
   alert("代碼已經(jīng)剪切到剪切板");
 }else{
   alert("此功能只能在IE上有效\n\n請在文本域中用Ctrl+A選擇再剪切")
 }
}

//粘貼代碼
function paste(obj) {
 if (document.all){
   textRange = getByid("runcode"+obj).createTextRange();
   textRange.execCommand("paste");
   alert("粘貼代碼");
 }else{
   alert("此功能只能在IE上有效\n\n請在文本域中用Ctrl+v選擇再粘貼")
 }
}
</script>

 <table width="100%" border="0" cellpadding="0" cellspacing="0">
 <form name=form1>
   <tr>
     <td height="530" colspan="6"><textarea name="text" id="runcode0" cols="72" rows="9" style="width:100%;height:98%;"> </TEXTAREA></td>
    </tr>
   <tr>
     <td height="53"><input type="button" value="運行代碼" id="0" onClick="runCode(this.id)" class="sumit1"></td>
     <td><input type="button" value="保存代碼" id="0" onClick="saveCode(runcode0)" class="sumit2"></td>
     <td><input type="button" value="復(fù)制代碼" id="0" onClick="doCopy(this.id)" class="sumit3"></td>
     <td><input type="button" value="剪切代碼" id="0" onClick="cut(this.id)" class="sumit4"></td>
     <td><input type="button" value="粘貼代碼" id="0" onClick="paste(this.id)" class="sumit5"></td>
     <td><input type="button" value="清空代碼" id="0" onClick="document.form1.text.value='';" class="sumit6"></td>
   </tr>
  </form>
 </table>
 

 

 

 


相關(guān)閱讀
asp與數(shù)據(jù)庫sql的種種操作
網(wǎng)頁制作中注意應(yīng)用HTML標(biāo)簽的問題
利用fso判斷文件是否存在
烏魯木齊旅游
window.location.href和setTimeout結(jié)合時間錯誤
深山留言板v4.8 - 5.13母親節(jié)模板
陽光港澳旅行網(wǎng)
利用CSS設(shè)置網(wǎng)頁滾動條顏色
共有0條關(guān)于《一個運行HTML文件的代碼》的評論
發(fā)表評論
正在加載評論......
返回頂部發(fā)表評論
呢 稱:
表 情:
內(nèi) 容:
評論內(nèi)容:不能超過 1000 字,需審核,請自覺遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。
驗證碼: 驗證碼 
網(wǎng)友評論聲明,請自覺遵守互聯(lián)網(wǎng)相關(guān)政策法規(guī)。

您發(fā)布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權(quán)益;
二、不得發(fā)布國家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對自己在本站的言論和行為負(fù)責(zé);
三、本站對您所發(fā)布內(nèi)容擁有處置權(quán)。

更多信息>>欄目類別選擇
百度小程序開發(fā)
微信小程序開發(fā)
微信公眾號開發(fā)
uni-app
asp函數(shù)庫
ASP
DIV+CSS
HTML
python
更多>>同類信息
dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
javascript獲取瀏覽器指紋可以用來做投票
火狐Mozilla Firefox出現(xiàn):無法載入您的Firefox配置文件 它可能已經(jīng)丟失 或是無法訪問 問題解決集合處理辦法
DW設(shè)置之后更好用 DreamweaverCS編輯GB2312與UTF-8文件在代碼視圖中點擊鼠標(biāo)錯位問題的解決辦法
js指定日期加n天加n月加n年
jquery中動態(tài)生成的代碼使用on hover事件時不出現(xiàn)效果
更多>>最新添加文章
dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
Android移動端自動化測試:使用UIAutomatorViewer與Selenium定位元素
抖音直播音掛載小雪花 懂車帝小程序
javascript獲取瀏覽器指紋可以用來做投票
火狐Mozilla Firefox出現(xiàn):無法載入您的Firefox配置文件 它可能已經(jīng)丟失 或是無法訪問 問題解決集合處理辦法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
python通過代碼修改pip下載源讓下載庫飛起
python里面requests.post返回的res.text還有其它的嗎
更多>>隨機(jī)抽取信息
開始百度小程序開發(fā)需要準(zhǔn)備工作
Javascript JS 限制復(fù)選框的選擇個數(shù)(3)
asp判斷是否是手機(jī)訪問
微信小程序轉(zhuǎn)uni-app項目
asp導(dǎo)出內(nèi)容到excel表并自定義命名后下載(非打開)
吉林省天馬旅行社
主站蜘蛛池模板: 一级毛片视屏 | 中文字幕在线永久在线视频 | 一区二区中文字幕 | 午夜看片 | 中文字幕av一区二区三区免费看 | 成人在线播放 | 天天操操| √新版天堂资源在线资源 | 好姑娘影视在线观看高清 | 日韩综合| 伊人青青操 | 97国产精品| 亚洲性爰 | 男女免费在线观看视频 | 精品国产黄a∨片高清在线 激情网站免费 | 国产在线中文字幕 | 黄色电影天堂 | 欧美一区二区三 | 欧美怡红院视频一区二区三区 | 欧美日韩在线精品 | 精品在线看 | 日韩成人一区二区 | 91av国产精品 | av在线免费观看一区二区 | 人人干人人看 | 亚洲一区二区三区高清 | 欧美日韩福利视频 | 成人av在线播放 | 久久国产精品99久久久久久老狼 | 中文字幕在线综合 | 久久久久久久久综合 | 成人天堂噜噜噜 | 欧美一二区 | 久久久国产精品 | 91精品一区二区三区久久久久久 | 日日撸 | 国产一级视频 | 国产三级精品在线 | 这里只有精品在线视频观看 | 99国产精品 | 久草电影网 |