i have JSP which has a HTML form. on load i have put the below mentioned code to set focus in a text field on load. but when i refresh the page in the same IE window, the focus vanishes and there is a permission denied error. what shud i do?
"& lt;" body
on load="document.loginform.username.focus()""& lt;" [ September 06, 2005: Message edited by: Neeraj Macker ]
kundan varma, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.
I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.
I'm not sure that that will help the original poster at all, and it's actually rather poor practice.
The onload handler is the best place for any script that needs to execute on page load and that references any elements in the DOM. The DOM is guaranteed to have been loaded by the time that the onload handler executes. Otherwise, you introduce a race condition in which it is possible for the inline script to be executred before the DOM has been compeletely loaded.
Hi Bear I am extremely sorry for using such shortcuts but even i dont generally use such abbreviations and also english is not my native language . I was in hurry that time and saw that somebody is having the same problem as me and just asked one question "r u using xp sp2" . Let me put in this way. I wanted to say "Are you using windows Xtreme Programming service pack 2 ". Thanks kundan
Failures are practice shoots for success.