使用的是editor(http://lab.lepture.com/editor)富文本编辑器,加上了这样一段
,
点击图片,弹出框使用了bootstrap-dialog插件,结果如下图:
报错: Uncaught InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('file') does not support selection.
求教各位大神怎么解决,或者有什么替代方案!!谢谢!!
代码如下:
var editor = new Editor();
editor.render();
$('.icon-image').click(function(){
BootstrapDialog.show({
title: '插入图片',
// message: $('
本地图片: '),message: $('
本地图片:
'),buttons: [
{
label: '取消',
cssClass: 'btn-default',
action: function(dialog) {
dialog.close();
}
},
{
label: '确定',
cssClass: 'btn-primary',
action: function(dialogRef) {
$.ajax({
type: 'POST',
url: '/uploadimage',
data: {'image': image},
success: function(msg){
alert(msg);
dialogRef.close();
}
});
},
}
]
});
});
另外,使用注释掉的message是可以把图片传到后台的!
玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/wenda/wd18882.html
相关文章 Recommend