gpt4 book ai didi

javascript - 试图让图像以 HTML 形式发出警报

转载 作者:行者123 更新时间:2023-11-30 15:55:39 26 4
gpt4 key购买 nike

我对 HTML 和编码还很陌生;我正在开发一个围绕游戏的非常基本的网页。虽然这可能是其他地方的答案,但我无法得到直接的答案。请记住,我是这个 block 的新手,所以我不会理解更高级的术语。

function myFunction {
alert("Invoker is a ranged intelligence hero who is very difficult to master. He is unique in that he possesses a total of 14 abilities in his arsenal; three of them - Quas, Wex, and Exort - are reagents and one is his special ultimate Invoke. The three abilities he learns throughout leveling up can have three instances, which serve as the basic ingredients or components for him to create a new ability using his ultimate. Once the reagents or elements are combined, he can invoke one out of ten different abilities. All of his invoked abilities are capable of a multitude of actions, from damaging enemies to aiding his allies, and even saving himself from danger. His three reagents can be upgraded up to level 7 which determines the power and potency of his invoked abilities, making it more powerful than an ordinary spell. Because of this, he can be played in almost any role possible. Invoker can be a carry, semi-carry, ganker, pusher, initiator or even support. His three reagents provide passive attributes with each level, and each instance of his reagents provides a passive bonus, allowing for specialization at early levels and situational boosts at later levels. His extremely flexible nature allows him to use many different combinations of items effectively but also make him dependent on solid builds and a good gold advantage. Because of the extra points needed to level his three reagents, Invoker also has a special Attribute Bonus ability at level 25 that allows him to gain 6 points in all stats.");
}
<html>
<head>
<title>ICT</title>
<link rel="stylesheet" type="text/css"href="Style 1.css">
<style type="text/css">
</style>
<script type="text/javascript" src="Dota2 Heroes Alarm.js">
</script>
</head>



<body bgcolor=blue>


<div style="position: absolute; left: 10px; top: 40px;">
<img src="Invoker_Icon.png" width="32" height="32" onclick="myFunction;" />
</div>

当我单击图像“Invoker_Icon.png”时,它不会创建警告框。

提前谢谢你,这一直困扰着我。

谢谢,

托马斯

最佳答案

您需要通过添加括号实际调用该函数。

您的处理程序属性代码实际上没有执行任何操作。

关于javascript - 试图让图像以 HTML 形式发出警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38599201/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com