简体   繁体   English

如何通过 textarea 或 html 编辑器插入图像?

[英]How to insert image through textarea or html editor?

i have textarea where user can input some text, and this works but the problem arises when he wants to insert the image...我有文本区域,用户可以在其中输入一些文本,这有效,但是当他想插入图像时出现问题...

if he put this for example in textarea (Thumbnail image (linked) code)如果他把它放在例如 textarea 中(缩略图图像(链接)代码)

<a href="http://www.ultraimg.com/image/1V6n"><img src="http://ultraimg.com/images/2016/08/11/1V6n.md.jpg" alt="1V6n.jpg" border="0" /></a>

when he clicks save button, after that it show the same img code, but there is no image...当他点击保存按钮时,它显示相同的 img 代码,但没有图像......

so i started to use ckeditor but the situation is the same....所以我开始使用 ckeditor 但情况是一样的....

so please tell what i need to ?所以请告诉我需要什么?

Thank you谢谢

Instead oftextarea , you may use contentEditable .您可以使用contentEditable代替textarea

For limitations and usage take a look to the reported links.有关限制和用法,请查看报告的链接。

This is an example:这是一个例子:

 <div contenteditable="true"> <a href="http://www.ultraimg.com/image/1V6n"><img src="http://ultraimg.com/images/2016/08/11/1V6n.md.jpg" alt="1V6n.jpg" border="0" /></a> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在HTML的输入或文本区域内插入标签 - How to insert tags inside a input or textarea in html 如何使用textarea插入html和javascript代码 - How to insert html and javascript code with textarea 如何通过富文本编辑器使用 JavaScript 和 PHP 将带有编码的 HTML 标签的数据插入到数据库中? - How to insert data into database with encoded HTML tags using JavaScript and PHP through rich text editor? “受限” HTML textarea /所见即所得编辑器? - “Constrained” HTML textarea/WYSIWYG editor? 如何获得由javascript html编辑器控制的textarea的值? - How to get value of a textarea which is controlled by a javascript html editor? 如何使用javascript在textarea中输入Html编辑器 - How to get input of Html editor in textarea using javascript 如何在光标的编辑器中插入文本/ HTML - How to insert text/HTML into editor at the cursor 将图像插入tinymce编辑器 - Insert an image into a tinymce editor 如何在HTML文本区域中从用户输入文本并删除HTML标记,还可以在文本区域中搜索单词? - How to input text from user in HTML textarea and remove the HTML tags and also search through the textarea for a word? 如何在HTML应用程序中集成Shutterstock Image Editor? - How to Integrate Shutterstock Image Editor in HTML app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM