javascript - window.location 在新选项卡中打开链接
问题描述
到目前为止我有
<div style="position: absolute; left: 47%; top: 70%; margin-right: -52%; transform: translate(-50%, -50%)" onclick="window.location='https://steamcommunity.com/';">
我想在新选项卡中打开此页面,但使用 window.open 时遇到问题,因为该类是图像。有什么建议么?
解决方案
您可以改用 target="_blank":
<a href="https://steamcommunity.com/'" target="_blank"/>
推荐阅读
- c# - “可空引用类型”功能目前处于预览阶段,*不受支持*
- javascript - 单击表格按钮获取动态创建的表格单元格值
- swift - Swift - 'internal' 修饰符不能在协议中使用
- stm32 - 如何读取STM32H7 SRAM ECC状态?
- python - 使用 python 和 spacy 文本摘要
- razor - 将 Checkbox 绑定到复杂类型需要实现 TypeConverter
- json - Powershell 显示 JSON-object 和 ADDRESS-property 的错误输出
- asp.net-core-webapi - 如何在 web api 中编写连接并从两个表中检索字段
- python-3.x - 将一列中的数字添加到熊猫数据框中另一列中的日期
- android - 这可能吗,GNOME (lib)Clutter with OpenGL ES & Vulkane?