473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

native code attached to onblur/onfocus event handler

Hi All,

In Mozilla Firefox, to onblur and onfocus event of each and every
html element, the browser itself will attach a native event handler. I
mean if you type, 'javascript:alert(window.blur)' in the address bar
of Firefox browser, you can see a 'function ....' . That is a Firefox
browser defined handler.

Now assume that web developer also attach event handlers to 'onblur'
events eg: 'window.blur=f3()'

Is there any way to check if the event handler is a browser attached
handler OR a web developer attached event handler ?

Regards,
Kiran.
Nov 19 '08 #1
2 4661
On Nov 19, 6:12*am, wolverine <kiran.ha...@gmail.comwrote:
Hi All,

In Mozilla Firefox, *to onblur and onfocus event of each and every
html element, the browser itself will attach a native event handler. I
Do tell.
mean if you type, 'javascript:alert(window.blur)' in the address bar
of Firefox browser, you can see a 'function ....' . That is a Firefox
browser defined handler.
Is it? Not unexpectedly, IE shows the same thing.
>
Now assume that web developer also attach event handlers to 'onblur'
events eg: 'window.blur=f3()'
That is not an event handler (or even a known property) and unless f3
is a factory function, the right side is wrong too. Perhaps you meant
"window.onblur = f3;"?
>
Is there any way to check if the event handler is a browser attached
handler OR a web developer attached event handler ?
In other words, you want to know if a property (e.g. onblur) of an
element has been set by another script? There is no standard way to
do this. If you need to support just a few browsers and they all
return the same toString results, then you could look for the string
you saw in the alert. Better yet, figure out a way to factor this
decision out of the system.
Nov 19 '08 #2
On Nov 19, 4:29*pm, David Mark <dmark.cins...@gmail.comwrote:
On Nov 19, 6:12*am, wolverine <kiran.ha...@gmail.comwrote:
Hi All,
In Mozilla Firefox, *to onblur and onfocus event of each and every
html element, the browser itself will attach a native event handler. I

Do tell.
mean if you type, 'javascript:alert(window.blur)' in the address bar
of Firefox browser, you can see a 'function ....' . That is a Firefox
browser defined handler.

Is it? *Not unexpectedly, IE shows the same thing.
Now assume that web developer also attach event handlers to 'onblur'
events eg: 'window.blur=f3()'

That is not an event handler (or even a known property) and unless f3
is a factory function, the right side is wrong too. *Perhaps you meant
"window.onblur = f3;"?
Is there any way to check if the event handler is a browser attached
handler OR a web developer attached event handler ?

In other words, you want to know if a property (e.g. onblur) of an
element has been set by another script? *There is no standard way to
do this. *If you need to support just a few browsers and they all
return the same toString results, then you could look for the string
you saw in the alert. *Better yet, figure out a way to factor this
decision out of the system.
Thanks a lot.

Sorry for posting that stupid a question in the groups. I was confused
and thought 'window.blur' is a event handler for 'blur' event on
window.
Nov 20 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave Hammond | last post by:
Hi All, I have a web form which performs certain actions upon moving focus away from a field. However, if the user clicks the top corner 'X' icon to close the window, the onBlur event still...
4
by: josh.dutcher | last post by:
I'm trying to set up a simple "change your password" form. I've got an AJAX process that is checking the new password the user enters against their current password to make sure they're changing...
2
by: hrpreet | last post by:
Hi All, I have few textfields and dropdowns in my jsp, form is submitted on clicking an image link. In case there is an error for instance some text field is left empty, then message is...
3
by: Nebulus | last post by:
Hey all. I'm working on some VERY big forms, and the user will easily lose their location if they get distracted - which happens a lot with the amount of phone traffic they get. Anyway, I have a...
4
by: Dabbler | last post by:
Is there a way to mark the text in a TextBox control as selected so when the user types a new value the existing text is replaced? Thanks
7
by: laredotornado | last post by:
Hi, Using the onblur handler in a text field, how can I check if the value was changed from what was originally there prior to the user focussing on the text field? Thanks, - Dave
1
by: suneel271 | last post by:
code working in internet explorer but not in mozilla and iam getting erroe like window.event has no properties and here is the code <%@ page language="java" contentType="text/html;...
2
by: laredotornado | last post by:
Hi, What handler would I set on a particular DIV if a user mouses out of that DIV or clicks outside of that DIV? Thanks, - Dave
1
by: Radu | last post by:
Hi. I am trying to localize a page AND simulate the AJAX watermarks in it, i.e. the textbox contains the text "Enter your name", or "Entrez votre nom", for instance, then on click, delete this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.