function runCode(codeobjid) {
VAR codeobj=document.getElementById(codeobjid)
var codestr=codeobj.value;
if (codestr!="") {
var codewin=window.o
PEn('','','');
codewin.document.open('text/ht
ML','replace');
codewin.opener = null
codewin.document.wr
ITe(codestr);
codewin.document.close();
}
re.Pattern="\[html\](<
br>)+"
strContent=re.Replace(strContent,"【html】")
再找到 re.Pattern="\[code\](.*?)\[\/code\]",然后在段代码的 Set strMatches=Nothing 之后添加如下代码:
re.Pattern="\[html\](.*?)\[\/html\]"
Set strMatches=re.Execute(strContent)
For
each strMatch In strMatches
RNDStr=Int(7999 * Rnd + 2000)
tmpStr1=strMatch.SubMatches(0)
strContent= Replace(strContent,strMatch.Value,"<textarea rows=""10"" "_
&
amp;"style=""width:90%;"" class=""input_border"" id=""HTML_"&RNDStr&""">"_
&tmpStr1&"</textarea><br />"_
&"<input type=""button"" onclick=""runCode('HTML_"&RNDStr&"');"" value=""运行代码"" />"_
&" [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]")
Next
3. 修改完成,在发表日志时就可以使用【html】要运行的代码【/html】(将【】替换成[])来使用运行代码功能。