我想写一个方法传入一个html内容返回的是js的字符串参考代码(页面的):
<script>
function change(){
oResult.value="document.writeln(\""+oSource.value.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\'/g,"\\\'").replace(/\"/g,"\\\"").split('\r\n').join("\");\ndocument.writeln(\"")+"\")"
} </script>参考网址:http://www.hao123.com/haoserver/jstohtm.htm牛人们 多多指教给我写一下。。谢谢
<script>
function change(){
oResult.value="document.writeln(\""+oSource.value.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\'/g,"\\\'").replace(/\"/g,"\\\"").split('\r\n').join("\");\ndocument.writeln(\"")+"\")"
} </script>参考网址:http://www.hao123.com/haoserver/jstohtm.htm牛人们 多多指教给我写一下。。谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货