JavaScript focus() function not working in "start without debugging"

A

AnalogKid17

I have the following line of code in my start/login page:

document.getElementById("txtLogin").focus();

When I run the website app through F5 (Debug, Start Debugging) it works
fine (ie, focus on txtLogin). When I run with CTRL+F5 (Debug, Start
without debugging) the focus defaults to the URL box.

Can anybody unveil the mystery ?

Thanks.

Keywords: javascript focus dotnet .net debug "stOOpid problem"
 
M

Marina Levit [MVP]

I am guessing the debugger is interfering with focus. In general, when
using the debugger in any type of application, all sorts of events can be
interrupted or changed just because the debugger is there.
 
A

AnalogKid17

Marina said:
I am guessing the debugger is interfering with focus. In general, when
using the debugger in any type of application, all sorts of events can be
interrupted or changed just because the debugger is there.
I see... thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top