本文介绍了JavaScript警报中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道这是一个不明智的问题,但是如果可能的话 -
I know it's a unwise question but if it's possible -
我们可以在JavaScript警告框中显示图像吗?
Can we show a image in JavaScript alert box?
如果有可能,我们该怎么做?
If it's possible, How can we do this?
推荐答案否。您无法在JavaScript的原生 alert()框中显示图片。
No. You cannot display an image inside JavaScript's native alert() box.
旁注: alert()显示为纯文本输入的内容,这意味着您无法传递包含< img> 标记到它并希望它显示图像 - 它将显示字符串< img src ...>。
Side note: alert() displays what's given to it as input as pure text, meaning you cannot pass a string containing an <img> tag to it and expect it to display an image - it will instead display the string "<img src...>".
更多推荐
JavaScript警报中的图像
发布评论