Help - Search - Members - Calendar
Full Version: Set Focus on Address Bar
HTMLHelp Forums > Web Authoring > Web Site Functionality
DeaPeaJay
I'm wondering, is it possible to set the focus of the browser to the address bar through the web page?

I'm creating a sort of start page for myself primarily, and eventually others. But when I set the site as my home page, when the browser takes me to the site, the focus no longer remains on the address bar. So if I want to type in an URL instead of clicking on one of the links, I have to manually put the focus back on the address bar. I can hit command L easily enough to do this, but it would be nice if I didn't have to.

I can't imagine a web page would have access to the browser on that level, but I was just curious if anyone knew of a way to do this.

Here's the site I'm working on: http://whereyouoff.to/
DeaPeaJay
You know as I'm thinking about this. I'm beginning to doubt that it's possible. I can set the window.location and get it. But if I were able to manipulate it, that would have security implications I would think. A phishing site for example could modify the browser URL so that it would look you're on a different site than you are. I'm not talking about changing the URL in this case, but being able to set the focus I would think carry with it the abilty to manipulate it.

bummer.

I tried setting window.location to "" but that doesn't work either, just makes my browser go crazy trying to load nothing.
pandy
I don't think it's possible either, it shouldn't be. But sure I'm not. cool.gif
Christian J
A workaround might be to put the focus on a text field, then use its value for window.location (when the Enter key is pressed?).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.