Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > native code attached to onblur/onfocus event handler

Reply
Thread Tools

native code attached to onblur/onfocus event handler

 
 
wolverine
Guest
Posts: n/a
 
      11-19-2008
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.
 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      11-19-2008
On Nov 19, 6:12*am, wolverine <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
 
 
 
wolverine
Guest
Posts: n/a
 
      11-20-2008
On Nov 19, 4:29*pm, David Mark <(E-Mail Removed)> wrote:
> On Nov 19, 6:12*am, wolverine <(E-Mail Removed)> wrote:
>
> > 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
preventing an event handler attached by attachEvent getting executed wolverine Javascript 3 09-28-2007 05:52 AM
preventing an event handler attached by attachEvent getting executed wolverine Javascript 0 09-27-2007 02:31 PM
Windows XP freezes when USB mouse/keyboard are attached but not when a serial set is attached John Dalberg Computer Support 4 06-17-2007 09:27 AM
Event Handler that creates adds another event handler kaczmar2@gmail.com ASP .Net 1 02-22-2007 07:37 AM
Call from attached thread in native code via JNI crashes. Why? RThaden@web.de Java 2 08-02-2006 07:06 AM



Advertisments