如何将客户端的图像插入编辑器?
就像使用 JavaScript 将图像插入编辑器的“插入”菜单一样,我根本不知道解决方案是什么,
应该分两步:
让用户选择一个图像(这应该是可通过
input type=file
实现)。将选择的图像插入到编辑上下文中(不知道如何实现)。
Like an "insert" menu, by which to insert an image into the editor, using JavaScript, I've no idea what's the solution at all,
should be in 2 steps:
Let the user choose an image (this should be doable by an
input type=file
).Insert the chosen image into editing context(don't know how to implement).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不将图像上传到服务器,您将无法实现此目的,因为您在文本区域内可以拥有的唯一参考是公共网站(即不是用户的硬盘驱动器)。
我建议检查 IMCE; 这就是我用的。
它允许用户上传图像。 与一个不错的 WYGIWYS 编辑器(例如 TinyMCE)一起使用,它就像一个魅力。
You won't be able to achieve this without uploading the image to your server, since the only reference you can have inside the text area is to a public website (i.e. not the users hard drive).
I'd recommend checking IMCE; that's what I use.
It allows the user to upload images. Together with a nice WYGIWYS editor such as TinyMCE it works like a charm.