首页 > 解决方案 > 单击图像,尝试显示描述

问题描述

我正在做一个小论坛,在这个论坛上我有一些不同的图像。我想看看我是否可以单击图像并简要说明用户单击的图像。我无法看到如何实现这一点,这就是我到目前为止所拥有的:

<a class="desc" href="https://www.horizon-dawn.com/about">
    <img id="Horizon" src="https://image.api.playstation.com/vulcan/ap/rnd/202010/0221/vC7trMorHJgbImp8PCQvpI0p.png">
    </img>
</a>

这将使图像可点击,然后一旦您单击图像,它总是将我重定向到"This site can't be reached"错误。在我链接到 HTML 的 JavaScript 文件中,我有这一行,需要修改,但我不知道如何:

app.get("/about", (req, res) => {
    res.render("description", {
      description: "Horizon Zero Dawn is a 2017 action role-playing game developed by Guerrilla Games and published by Sony Interactive Entertainment. The plot follows Aloy, a young hunter in a world overrun by machines, who sets out to uncover her past. The player can explore the open world to discover locations and take on side quests."
    })
});

我正在使用 node.JS 并拥有我安装的 NPM express。

任何帮助将不胜感激。非常感谢

标签: javascripthtmlnode.js

解决方案


推荐阅读