亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

百度ueditor組件上傳圖片后如何設(shè)置img里的alt屬性

 更新時(shí)間:2014年09月01日 08:58:01   投稿:whsnow  
百度ueditor組件,使用上傳圖片后,設(shè)置了一個(gè)alt屬性,其值是上傳圖片時(shí)的本地路徑,如果想更改的話可以參考下面的解決方法

百度ueditor組件,使用上傳圖片后,自動(dòng)將上傳圖片顯示在編輯器中,也就是插入了一個(gè)<img>標(biāo)簽。并設(shè)置了一個(gè)alt屬性,其值是上傳圖片時(shí)的本地路徑。暫時(shí)沒發(fā)現(xiàn)哪里可以配置這個(gè)值。在查看發(fā)布的內(nèi)容時(shí),看到alt的值是一個(gè)磁盤路徑,有點(diǎn)別扭。

可以在編輯完內(nèi)容,保存到數(shù)據(jù)庫時(shí)過濾下,修改alt的內(nèi)容,也可以直接修改源碼

function callback(){
try{
var link, json, loader,
body = (iframe.contentDocument || iframe.contentWindow.document).body,
result = body.innerText || body.textContent || '';
json = (new Function("return " + result))();
link = me.options.imageUrlPrefix + json.url;
if(json.state == 'SUCCESS' && json.url) {
loader = me.document.getElementById(loadingId);
loader.setAttribute('src', link);
loader.setAttribute('_src', link);
loader.setAttribute('title', json.title || '');
loader.setAttribute('alt', json.original || '');
loader.removeAttribute('id');
domUtils.removeClasses(loader, 'loadingclass');
} else {
showErrorLoader && showErrorLoader(json.state);
}
}catch(er){
showErrorLoader && showErrorLoader(me.getLang('simpleupload.loadError'));
}
form.reset();
domUtils.un(iframe, 'load', callback);
}

相關(guān)文章

最新評(píng)論