Python能实现编辑文本插入图片功能吗,,使用的是editor(h
Python能实现编辑文本插入图片功能吗,,使用的是editor(h
使用的是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: $('<form enctype="multipart/form-data" action="/uploadimage" method="post">本地图片: <input type="file" name="image"/><br/><input type="submit" value="upload" /></form>'), message: $('<p>本地图片: </p><input id="image" type="file" class="file" data-preview-file-type="text">'), 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是可以把图片传到后台的!
编橙之家文章,
相关内容
- Linux管道符和ssh传文件,,看到可以用一条命令传输文
- pycharm方便Pyramid项目跳转怎样实现,pycharmpyramid,怎么让
- Python一行代码运行顺序是怎样的?,python一行代码顺序
- Python非命令行环境下如何看到程序效果,python命令行
- django web开妈中随机获取某个分类下的文章的方法,dj
- python cmd窗口命令提示窗口关闭方法,pythoncmd,import oso
- python web缓存数据更新判断如何实现,pythonweb,问题情景
- python tornado mongo驱动应该如何选择,tornadomongo,背景我用
- pyton celery工作流的问题,pytoncelery工作流,celery中,我做这
- 理论方面Python可以编译小Python内核数量是多少,python内
评论关闭