如何在 Purescript 中获取浏览器 URL,就像在 javascript 中执行
window.location.href
一样?
import Web.HTML (window)
import Web.HTML.Window (location)
import Web.HTML.Location (pathname)
import Effect.Console (log)
main :: Effect Unit
main = do
l <- window >>= location >>= pathname
log $ l