gpt4 book ai didi

javascript - 我想打开 onclick 两个页面,一个内部页面,一个外部页面

转载 作者:行者123 更新时间:2023-11-28 01:17:23 26 4
gpt4 key购买 nike

你能告诉我如何准确地修复这段代码吗?这里我有两个内部代码和两个外部代码(到 youtube)

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>LS_model</title>
<link href="ls.css" rel="stylesheet">
<link href="index.css" rel="stylesheet">
</head>
<body>
<div id="space"><br></div>
<div id="container">
<div id="wb_Image1" style="position:absolute;left:62px;top:291px;width:876px;height:524px;z-index:0;">
<img src="images/Background.png" id="Image1" alt=""></div>
<div id="wb_Image2" style="position:absolute;left:75px;top:31px;width:840px;height:260px;z-index:1;">
<img src="images/ads.gif" id="Image2" alt=""></div>
<div id="wb_Image3" style="position:absolute;left:126px;top:343px;width:140px;height:57px;z-index:2;">
<a href="#" onclick="window.location.href='./page22.html';window.open('https://www.youtube.com/watch?v=5u7ytZmxstY');return false;"><img src="images/videoss-b.gif" id="Image3" alt=""></a></div>
<div id="wb_Image4" style="position:absolute;left:723px;top:344px;width:140px;height:56px;z-index:3;">
<a href="#" onclick="window.location.href='./page1.html';window.open('https://www.youtube.com/watch?v=5u7ytZmxstY');return false;"><img src="images/Photos-b.gif" id="Image4" alt=""></a></div>
</div>
</body>
</html>

最佳答案

试试这个

使用 window.open 打开两个页面并从您的代码中删除 return false

<a href="#" onclick="window.open('./page1.html');window.open('https://www.youtube.com/watch?v=5u7ytZmxstY');"><img src="images/Photos-b.gif" id="Image4" alt=""></a>

关于javascript - 我想打开 onclick 两个页面,一个内部页面,一个外部页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35195816/

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