JavaScript警报中的图像

编程入门 行业动态 更新时间:2024-10-11 05:20:27
本文介绍了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警报中的图像

本文发布于:2023-11-27 17:53:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639014.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:警报   图像   JavaScript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!