部分代码:
-----------------------------------------------------------------------
objname="intro";
html="<img src='/pic/<%=newname%>'>";
var editor_obj =parent.document.all["_" +objname + "_editor"];
var isTextarea = (editor_obj.tagName.toLowerCase() == 'textarea');if (isTextarea) { editor_obj.value += html; }
else { editor_obj.contentWindow.document.body.innerHTML += html; }
----------------------------------------------------------------------------在这句中
if (isTextarea) { editor_obj.value += html; }
textarea中会加入比如 <img src='/pic/ssss.jpg'>
而在这句中
editor_obj.contentWindow.document.body.innerHTML += html;
textare中会加入<img src='http://www.xxx.com/pic/sss.jpg''>
怎么把第二种情况下的绝对域名去掉
-----------------------------------------------------------------------
objname="intro";
html="<img src='/pic/<%=newname%>'>";
var editor_obj =parent.document.all["_" +objname + "_editor"];
var isTextarea = (editor_obj.tagName.toLowerCase() == 'textarea');if (isTextarea) { editor_obj.value += html; }
else { editor_obj.contentWindow.document.body.innerHTML += html; }
----------------------------------------------------------------------------在这句中
if (isTextarea) { editor_obj.value += html; }
textarea中会加入比如 <img src='/pic/ssss.jpg'>
而在这句中
editor_obj.contentWindow.document.body.innerHTML += html;
textare中会加入<img src='http://www.xxx.com/pic/sss.jpg''>
怎么把第二种情况下的绝对域名去掉
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货