婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識(shí)庫 > asp下實(shí)現(xiàn)代碼的“運(yùn)行代碼”“復(fù)制代碼”“保存代碼”功能源碼

asp下實(shí)現(xiàn)代碼的“運(yùn)行代碼”“復(fù)制代碼”“保存代碼”功能源碼

熱門標(biāo)簽:西寧公司外呼系統(tǒng)平臺(tái) 騰訊地圖標(biāo)注商戶關(guān)閉 徐州人工智能電銷機(jī)器人好用嗎 地圖標(biāo)注宅基地 武漢營(yíng)銷電話機(jī)器人軟件 外呼系統(tǒng)還用卡么 智能電銷機(jī)器人適用于哪些行業(yè) 地圖標(biāo)注服務(wù)哪家好 長(zhǎng)沙防封電銷卡品牌
Function content_Code(Str)
dim ary_String,i,n,n_pos
ary_String=split(Str,"[ code ]")
n=ubound(ary_String)
If n1 then
content_Code=Str
Exit function
End If
for i=1 to n
n_pos=inStr(ary_String(i),"[/ code ]")
If n_pos>0 then
ary_String(i)="br />textarea class=gocode id=runcode"i" name=runcode"i">" server.HTMLEncode(left(ary_String(i),n_pos-1))"/textarea>br />input type=button class=input-code value=運(yùn)行代碼 onclick=runCode(runcode"i")>input type=button class=input-code value=復(fù)制代碼 onclick=copycode(runcode"i")>input type=button class=input-code value=另存代碼 onclick=saveCode(runcode"i")>span class=code-tishi>提示:您可以先修改部分代碼再運(yùn)行/span>br />" _
right(ary_String(i),len(ary_String(i))-n_pos-6)
Else
ary_String(i)="[code]" ary_String(i)
End if
next
content_Code=join(ary_String,"")
End Function

使用方法也很簡(jiǎn)單:
發(fā)表文章時(shí)需用使用“運(yùn)行代碼”功能的,主要前后加上
[ code ][/ code ]
比如:
[復(fù)制此代碼]CODE:
[ code ]
script type="text/javascript">
alert("簡(jiǎn)單吧");
/script>
[/ code ]
需要注意的是,在顯示的頁面要進(jìn)入以下javascript:

function runCode(obj) {
var winname = window.open('', "_blank", '');
winname.document.open('text/html', 'replace');
winname.opener = null
winname.document.writeln(obj.value);
winname.document.close();
}
function copycode(obj) {
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}
function saveCode(obj) {
var winname = window.open('', '_blank', 'top=10000');
winname.document.open('text/html', 'replace');
winname.document.write(obj.value);
winname.document.execCommand('saveas','','code.htm');
winname.close();
}

標(biāo)簽:雅安 普洱 巴彥淖爾 運(yùn)城 荊門 通化 通遼 鷹潭

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp下實(shí)現(xiàn)代碼的“運(yùn)行代碼”“復(fù)制代碼”“保存代碼”功能源碼》,本文關(guān)鍵詞  asp,下,實(shí)現(xiàn),代碼,的,運(yùn)行代碼,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp下實(shí)現(xiàn)代碼的“運(yùn)行代碼”“復(fù)制代碼”“保存代碼”功能源碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp下實(shí)現(xiàn)代碼的“運(yùn)行代碼”“復(fù)制代碼”“保存代碼”功能源碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 青神县| 保靖县| 宜丰县| 谢通门县| 兴仁县| 黔西| 襄城县| 邳州市| 东乡| 平南县| 永顺县| 赤城县| 堆龙德庆县| 永年县| 龙海市| 寿阳县| 横峰县| 特克斯县| 石渠县| 阜南县| 柳河县| 大丰市| 麻城市| 贵南县| 贵定县| 司法| 隆子县| 新余市| 尚义县| 太保市| 若尔盖县| 都安| 岳普湖县| 宝山区| 东乡族自治县| 根河市| 安溪县| 卢氏县| 德昌县| 怀远县| 奉贤区|