[removed] Setting location.href versus location

后端 未结 7 1767
野性不改
野性不改 2020-11-22 17:16

When would you set location to a URL string versus setting location.href?

location = \"http://www.stackoverflow.com\";
7条回答
  •  情歌与酒
    2020-11-22 17:57

    A couple of years ago, location did not work for me in IE and location.href did (and both worked in other browsers). Since then I have always just used location.href and never had trouble again. I can't remember which version of IE that was.

提交回复
热议问题