html - 如何使用 SCRIPT SRC 打开新标签页
问题描述
我正在尝试将付款按钮添加到我的网页(wix)。单击时,它会像小部件一样在同一个 iframe 中打开,但我希望它在单击时在新选项卡中打开。target="_blank"
不起作用。
示例代码:
<html>
<body>
<script src="https://www.example.com./integrations/v1/web-payment-checkout.js"
data-preference-id="example" data-source="button">
</script>
</body>
</html>
解决方案
使用 Bootstrap,您可以使用像button这样的锚点。
或使用样式自定义链接,使其看起来像一个按钮。
并使用 target="_blank" 在新选项卡中打开链接。
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<br>
<a class="btn btn-success" href="https://www.google.com" target="_blank">open google in new tab</a>
</body>
</html>
推荐阅读
- opencv - 使用 JavaCV 获取视频旋转元数据值
- python - 使用配对索引键连接两个数据帧
- php - 同一个变量似乎在 PHP 代码的不同部分具有不同的值
- r - R中带有传单(mapview)的地图顶部的鼠标坐标信息
- java - 在 Spring Boot 测试中测试 @Cacheable:未在 MockBean 上调用咖啡因缓存
- javascript - 为什么在我的 pong JavaScript 画布游戏中球不能完全反弹?
- java - Jackson 在 Android 上按字母顺序对 JSON 序列化输出键进行排序
- python - 将数据复制到缓冲区(字节数组)
- xamarin.forms - 将位图保存到图库并通过本地通知访问它
- python - sklearn python中的样本数量不一致