If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I've seen similar symptoms when someone tries to reference an element that isn't fully loaded yet. The alert() gives the browser sufficient time to continue loading and so the script works. When the alert() is removed the script does not work correctly.

Therefore, are you sure the element or whatever you are referencing before the alert(), is fully loaded by your browser before you try doing anything with it?

Unfortunately 2200+ lines is far too much code for me to look at with my limited attention span

I've seen similar symptoms when someone tries to reference an element that isn't fully loaded yet. The alert() gives the browser sufficient time to continue loading and so the script works. When the alert() is removed the script does not work correctly.

Therefore, are you sure the element or whatever you are referencing before the alert(), is fully loaded by your browser before you try doing anything with it?

Thanks for your reply tirna. You must be right with this assumption - maybe the element isn't fully loaded yet the time focus() fires up, may I know how would you deal with this kind of scenario, is there a way in PrototypeJS to suspend execution of focus() while the target element isn't fully loaded?

Originally Posted by tirna

Unfortunately 2200+ lines is far too much code for me to look at with my limited attention span

I've wish your editor could go to line at your request e.g. in notepad++, CTRL + 'g' would ask which line you want to go.

When the user clicks the + icon, various forms (including Href field) will be generated inside <div id="form_container" /> , he can draw map on the image, once the mouse has been release associated Href field should be focus(); see snippets from imgmap.js