How to hide urls from appearing in the address bar (using javascript)
I am developing an embedded web server. Now, I have an access validation page (e.g. http://192.168.1.1/) at the very start that accepts username and password and validates it and later redirects the users to the actual device control web page (http://192.168.1.1/devicecontrol.html). I do not want the actual url to appear开发者_如何转开发 on the address bar. Instead the initial url should be retained so that users cannot directly visit this page and neither be able to bookmark this page....I understand this must be a common requirement but could not find any specific answers to this...any help / references would be hugely appreciated....Thanks in advance.
That's not possible with Javascript alone. Use a Frameset (or if you're using Apache take a look at the mod_rewrite module).
One more advice: Don't do it! I would leave your site immediately, when I click around and the URL doesn't change. Looks like you're hiding something.
精彩评论