在使用kindEditor编辑器时,发现一个问题。kindEditor的图片上传本系统是完全OK啦,但是作为借口传出去呢?就会访问不到图片。我们看下上传后的图片地址,是从工程名开始的。没有服务器地址。所以外部当然调不到啦。那么怎么解决呢。看看kindeditor.js里面的一个方法:
- insertimage : function(url, title, width, height, border, align) {
- title = _undef(title, '');
- border = _undef(border, 0);
- var html = '<img src="' + _escape(url) + '" data-ke-src="' + _escape(url) + '" ';
- if (width) {
- html += 'width="' + _escape(width) + '" ';
- }
- if (height) {
- html += 'height="' + _escape(height) + '" ';
- }
- if (title) {
- html += 'title="' + _escape(title) + '" ';
- }
- if (align) {
- html += 'align="' + _escape(align) + '" ';
- }
- html += 'alt="' + _escape(title) + '" ';
- html += '/>';
- return this.inserthtml(html);
- }