我需要使用 ClojureScript 打开一个新选项卡。
(js/window.open "http://localhost/go/somewhere")
我收到以下错误:未捕获的类型错误:window.open 不是函数
它没有帮助设置它,因为没有任何反应,我认为这是因为它是一个函数而不是一个变量。
(set! js/window.open "http://localhost/go/somewhere")
我知道这是可能的,因为我一开始就做对了。从那以后我忘记了我做了什么。
编辑:也试过:
(set! js/window.location.open endpoint)
(set! (js/window.location.open -location) endpoint)
(set! (.. js/window.location.open -location) endpoint)