99亚洲_成人性视频免费网站_av在线播放网址_免费成人在线网站_亚洲综合婷婷_亚洲一区二区国产

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

一個運行HTML文件的代碼

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

以下是引用片段:

<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();
}

//復制代碼
function doCopy(obj) {
 if (document.all){
   textRange = getByid("runcode"+obj).createTextRange();
   textRange.execCommand("Copy");
   alert("代碼已經(jīng)復制到剪切板");
 }else{
   alert("此功能只能在IE上有效\n\n請在文本域中用Ctrl+A選擇再復制")
 }
}
//另存代碼
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="復制代碼" 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取得文件的名稱.路徑.建立日期.文件大小.文件類型
[轉(zhuǎn)]javascript緩沖效果
微信公眾號用戶關(guān)注時自動推送回復小程序卡片(圖文卡片)不需要第三方平臺就可以做
針對新的百度采集系統(tǒng)進行的文章內(nèi)容SEO基本優(yōu)化原則
web2.0中流行的設計元素:顏色
中國大宗資產(chǎn)交易網(wǎng)
增大、縮小、還原字體
ASP版通過身份證信息獲取對應的生日性別年齡
共有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ā)布內(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設置之后更好用 DreamweaverCS編輯GB2312與UTF-8文件在代碼視圖中點擊鼠標錯位問題的解決辦法
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還有其它的嗎
更多>>隨機抽取信息
網(wǎng)頁設計的十要十不要
chrome谷歌瀏覽器中的谷歌翻譯有問題一鍵修復處理
asp正則替換內(nèi)容里的特定內(nèi)容
Asp加密解密函數(shù)
對MD5加密方式使用者的建議
愛尚學生網(wǎng)
主站蜘蛛池模板: 99国产精品99久久久久久 | 山岸逢花在线观看无删减 | 亚洲欧美日韩精品久久亚洲区 | 国产精品国产精品国产专区不片 | 一区自拍 | 久久国产精品无码网站 | 成人精品福利 | 国产高清精品在线 | 日韩有码在线播放 | 一级a毛片 | 欧美日韩视频在线第一区 | 欧美日韩综合 | 黄篇免费观看 | 久久不卡 | 青青草中文字幕 | 一本久久综合亚洲鲁鲁五月天 | 色偷偷888欧美精品久久久 | 久久精品国产99国产 | 色狠狠一区二区三区香蕉 | 亚洲最大的黄色网 | 欧美理论视频 | 久久99国产精一区二区三区 | 久久久久久中文字幕 | 黄色国产 | 久久久久国产精品一区二区 | 综合精品| 成人av一区二区三区 | 亚洲国产精品成人 | 亚洲国产精品成人 | 97精品国产97久久久久久粉红 | 免费观看福利视频 | 欧美日韩高清不卡 | 亚洲视频一区在线播放 | 2015成人永久免费视频 | 成人在线观看日韩 | 日本免费视频 | www.嫩草| 一区二区三区有限公司 | 97色伦97色伦国产欧美空 | 成年人在线观看 | 久草福利在线视频 |