X
點擊此處開啟此網站的行動版。

技術支援討論區

location.assign('') not same as location.assign('/')

已張貼

location.assign('/') takes me to home page of site location.assign() does nothing (MS edge goes to home page) Not sure which is right, but would like consistency between browsers, for now using location.assign('/')

location.assign('/') takes me to home page of site location.assign('') does nothing (MS edge goes to home page) Not sure which is right, but would like consistency between browsers, for now using location.assign('/')
引用

額外的系統細節

已安裝的外掛程式

  • Shockwave Flash 32.0 r0

應用程式

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0

更多資訊

jscher2000
  • Top 10 Contributor
8797 個解決方法 71955 個答案

https://developer.mozilla.org/docs/Web/API/Location/assign says if you don't supply a valid URL, the browser will throw a syntax error.

https://developer.mozilla.org/docs/Web/API/Location/assign says if you don't supply a valid URL, the browser will throw a syntax error.
這篇文章有幫助嗎?
引用

提出問題者

Not sure, one browser says it is OK Firefox says not

Not sure, one browser says it is OK Firefox says not
這篇文章有幫助嗎?
引用
jscher2000
  • Top 10 Contributor
8797 個解決方法 71955 個答案

I suggest using MDN and the caniuse site for cross-browser compatibility information.

I suggest using MDN and the caniuse site for cross-browser compatibility information.
這篇文章有幫助嗎? 0
引用

提出問題者

Could you give me specific URL names?

Could you give me specific URL names?
這篇文章有幫助嗎?
引用
jscher2000
  • Top 10 Contributor
8797 個解決方法 71955 個答案

MDN is the site I linked to before, Mozilla Developer Network.

caniuse: https://caniuse.com/

MDN is the site I linked to before, Mozilla Developer Network. caniuse: https://caniuse.com/
這篇文章有幫助嗎?
引用
問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題