<style>
.q{border:1px solid gray;padding:0}
.q div{font-size:12px}
.q_t{padding:4px;background-color:#ffffe1;border-bottom:1px solid gray}
.q_c{padding:4px 4px 4px 12px}
#txt,#show{width:700px;border:1px solid navy;padding:4px}
#txt{height:220px;font:normal 11px "courier new"}
</style>
在这里将[Quote][/Quote]替换掉
<script>
function ubbQuote(str){
return str.replace(//[quote/]([/s/S]+)/[//quote/]/g,function(s0,s){
return "<div class=q><div class=q_t>引用内容:</div><div class=q_c>"+
ubbQuote(s)+"</div></div>";
});
}
function test(){
$("show").innerHTML=ubbQuote($("txt").value);
}
function $(id){
return document.getElementById(id);
}
</script>
<textarea id=txt>[quote]Hello[quote]Hello world[quote][quote]Hello world[/quote]Hello world[/quote][/quote] world[/quote]</textarea><br>
<input type=button value=test οnclick=test()><br>
<div id=show></div>
<span οnclick="javascript:try{Quote('<%#DataBinder.Eval(Container.DataItem,"dt_CommentDate")%>','<%#DataBinder.Eval(Container.DataItem,"dt_CommentDate")%>',0)}catch(ex){};return false">引用</span>