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

  • Thread starter Thread starter AnalogKid17
  • Start date Start date
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"
 
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.
 
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.
 
Back
Top