我用ewebeditor上传图片,传的值是 <IMG src= "../../upload/0/1/2005-06-1709_53_18.gif ">
但是在文本编辑器里显示的却是 <IMG src= "http://localhost:2706/upload/0/1/2005-06-1709_53_18.gif ">
怎样做能够插入<IMG src= "../../upload/0/1/2005-06-1709_53_18.gif ">而不是 <IMG src= "http://localhost:2706/upload/0/1/2005-06-1709_53_18.gif ">
但是在文本编辑器里显示的却是 <IMG src= "http://localhost:2706/upload/0/1/2005-06-1709_53_18.gif ">
怎样做能够插入<IMG src= "../../upload/0/1/2005-06-1709_53_18.gif ">而不是 <IMG src= "http://localhost:2706/upload/0/1/2005-06-1709_53_18.gif ">
2、用正则替换不需要的路径
伪代码如下: var currentpath = location.href;
var upPath = syspath.lastIndexOf("/");
syspath = syspath.substring(0, parseInt(upPath ) + 1);
//此处只提供样本,未经测试,需要自己测试重写正则表达式
syspath = syspath.replace("http://localhost:2706", "../..");