gpt4 book ai didi

elm - 通过端口调用window.open

转载 作者:行者123 更新时间:2023-12-04 14:17:38 24 4
gpt4 key购买 nike

我正在实现社交身份验证。当用户点击一个按钮时,我会发送一个命令,这样我就可以调用 window.open()

查看此调用堆栈,我们可以看到在下一个事件循环中调用了端口处理程序: enter image description here

由于 window.open 没有在点击事件生命周期内被调用,像 safari 这样的浏览器不允许弹出窗口出现。

你的方法是什么?

最佳答案

它不是 super 漂亮,但你可以做类似的事情

a 
[ Html.Attributes.attribute "onClick" "window.open(this.href, this.target, 'width=800,height=600'); return false;" ]
[ text "Click me" ]

关于elm - 通过端口调用window.open,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43295502/

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