gpt4 book ai didi

javascript - 使用 Javascript 在弹出窗口中打开链接

转载 作者:技术小花猫 更新时间:2023-10-29 12:52:05 25 4
gpt4 key购买 nike

<分区>

我正在尝试将 href 加载到特定尺寸的弹出窗口中,该窗口也位于屏幕中心。

这是我的来源:

<li>
<a class="sprite_stumbleupon" href="http://www.stumbleupon.com/submit?url=http://www.your_web_page_url" target="_blank" onclick="return windowpop(545, 433)"></a>
</li>

这是我的 javascript:

function windowpop(url, width, height) {
var leftPosition, topPosition;
//Allow for borders.
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
//Allow for title and status bars.
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
//Open the window.
window.open(url, "Window2", "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
}

这似乎在测试时返回 404 错误。我做错了什么?

非常感谢。

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