javascript - window.location.href but where the address bar changes -
for reason, using window.location.href
doesn't change url in user's address bar. there reason why i'm getting behavior?
code
earlier, posted code here. see i'm in frame. happens have same issue, window.top.location.href = 'page.htm'; trick.
ps. apologies not mentioning frame aspect. tiny, subtle use of frames. had known, wouldn't have asked question :)
thanks all!
you can frameset , adress bar won't change, no matter users navigate to.
but mentioned, internet explorer -since ie7- focuses on user prevent stuff that, user has right know surfing - security issue.
imagine come website looks clean , friendly , site redirects array of phishing sites without or browser security noticing it. site owner private info, e.g. clipboard content or geolocation data , while @ ease, site owner empties bank account. example.
in addition below answer tried window.location.href on firefox 3.6 , works expected.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>urlrefresh</title> </head> <body> <input type="button" value="changeadress" id="changeadress" /> <script> document.getelementbyid('getvalues').onclick = function() { window.location.href = "http://www.bing.com"; } </script> </body> </html>
if click button changeadress javascript issues request via browser desired website.
Comments
Post a Comment