在編輯器中添加鏈接必須添加以http://格式開頭的地址才能跳轉到外鏈地址
如果不加,就會帶入本域名地址,所以在需要設置一下:
this.editor = new E('#editor');
this.editor.customConfig.showLinkImg = false;
this.editor.customConfig.linkCheck = function(text, link) {
if (link != "") {
var reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
if (!reg.test(link)) {
return '請輸入正確的網址(例如 http://baidu.com)'
}else{
return true
}
}
}
this.editor.create(); //創建編輯器