KindEditor图片上传URL路径处理

在使用kindEditor编辑器时,发现一个问题。kindEditor的图片上传本系统是完全OK啦,但是作为借口传出去呢?就会访问不到图片。我们看下上传后的图片地址,是从工程名开始的。没有服务器地址。所以外部当然调不到啦。那么怎么解决呢。看看kindeditor.js里面的一个方法:

  1. insertimage : function(url, title, width, height, border, align) {  
  2.         title = _undef(title, '');  
  3.         border = _undef(border, 0);  
  4.         var html = '<img src="' + _escape(url) + '" data-ke-src="' + _escape(url) + '" ';  
  5.         if (width) {  
  6.             html += 'width="' + _escape(width) + '" ';  
  7.         }  
  8.         if (height) {  
  9.             html += 'height="' + _escape(height) + '" ';  
  10.         }  
  11.         if (title) {  
  12.             html += 'title="' + _escape(title) + '" ';  
  13.         }  
  14.         if (align) {  
  15.             html += 'align="' + _escape(align) + '" ';  
  16.         }  
  17.         html += 'alt="' + _escape(title) + '" ';  
  18.         html += '/>';  
  19.         return this.inserthtml(html);  
  20.     }  
我们就可以在这里拼接src了。


评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值