X
Tryk her for at gå til webstedets mobilversion.

Supportforum

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

Skrevet

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('/')
Citér

Yderligere systemdetaljer

Installerede plugins

  • Shockwave Flash 32.0 r0

Program

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

Yderligere information

Luk
jscher2000
  • Top 10 Contributor
8773 løsninger 71729 svar

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.
Fandt du dette nyttigt?
Citér

Spørgsmålsstiller

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

Not sure, one browser says it is OK Firefox says not
Fandt du dette nyttigt?
Citér
jscher2000
  • Top 10 Contributor
8773 løsninger 71729 svar

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.
Fandt du dette nyttigt? 0
Citér

Spørgsmålsstiller

Could you give me specific URL names?

Could you give me specific URL names?
Fandt du dette nyttigt?
Citér
jscher2000
  • Top 10 Contributor
8773 løsninger 71729 svar

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/
Fandt du dette nyttigt?
Citér
Stil et spørgsmål

Du skal logge ind på din konto for at svare på et indlæg. Start et nyt spørgsmål, hvis du ikke har en konto endnu.