Home > Not Working > Event.currenttarget Browser Compatibility

Event.currenttarget Browser Compatibility


Crowder's tickets Tisho Georgiev's tickets Tobie Langel's tickets Messages Milestones more 66 1.7 0 4 1.8 20 2.0 35 After 1.7 1 Inline documentation 1.7 Search Find tickets: [help] Keyword You flagged this item as spam. What does a white over red VASI indicate? Why do most microwaves open from the right to the left?

event.currentTarget : event.srcElement; Although as @Marc mentioned you can use a JQuery framework that normalizes the event for you. Example: setTimeout(function(arg1){}.bind(undefined, 10)); share|improve this answer edited Mar 28 '14 at 15:22 answered Mar 28 '14 at 15:14 Joe Frambach 17.8k73772 add a comment| up vote 0 down vote Alright, I e.g. $("#links li a").click(function(){ $(this).parent(); // points to the parent li of the clicked link }); Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript On Safari 8, the currentTarget property is undefined for both cases.

Event.currenttarget Browser Compatibility

Firefox inserts automatically a -tag in the tag-structure in the DOM-system. If you want to enable this functionality on that browser, you must use a compatibility code (see the Callback arguments paragraph). So I was wrong with that! If you need to pass an argument to your callback function, but need it to work in Internet Explorer, which doesn't support sending additional parameters (neither with setTimeout() or setInterval()) you

  1. Apparently it is a problem with passing events into functions in older IE.
  2. share|improve this answer edited Apr 4 '12 at 17:30 answered Dec 9 '09 at 19:41 Marc-André Lafortune 51.5k10115142 1 A comment for the downvote would be most welcome. –Marc-André Lafortune
  3. Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-02-2007,01:53 PM #1 dh2006 View Profile View
  4. Working Draft   Document Object Model (DOM) Level 2 Events SpecificationThe definition of 'Event.currentTarget' in that specification.
  5. Greetings Dieter Last edited by dh2006; 04-02-2007 at 08:11 PM.
  6. I don't know if .onXXX properties are deprecated, if they are not, I beleive they should be covered as well.
  7. Document Object Model (DOM) Document Object Model (DOM) Events Properties Properties currentTarget currentTarget currentTarget absolute acceleration accelerationIncludingGravity actionURL alpha altKey animationName attrChange attributeName attributeValue attrName beta bubbles button buttonID buttons cancelable

index.txt For reference to the dev who fixes the problem or nixes the bug report, I encountered this in the context of another bug report I just filed, so this file That was my point. –Hogan Feb 2 '13 at 21:38 add a comment| up vote 0 down vote currentTarget property is supported from IE version 9 onwards. I am not so familiar with jQuery, so I don't know if this is by design or it is a bug. Jquery Currenttarget You flagged this item as spam.

Events0Internet Explorer Javascript not running from event issue1How do I detect the number of clicks in Internet Explorer 10+2Javascript/JQuery drop event not firing in Internet Explorer IE 11 Hot Network Questions Event Currenttarget Vs Target Browse other questions tagged javascript internet-explorer events or ask your own question. How does Gandalf end up on the roof of Isengard? dunno bout js.

Quote from Mozilla Developer Network: On Internet Explorer 6 through 8, the event model is different. Srcelement event : window.event; if (typeof == 'undefined') { var target = event.srcElement; } else { var target =; } Make note that you re-write the event in standards compliant srcElement is the original source of the event, not necessarily the current target. –jhsowter Jul 19 '12 at 2:19 | show 3 more comments up vote 24 down vote I had You think "those jQuery guys" don't want people to know this?

Event Currenttarget Vs Target

With other browser (firefox, opera, chrome etc.) we can use event.currentTarget or also we can use the this keyword to refer to the object processing the event. But window is also a valid return value for Event.element here. Event.currenttarget Browser Compatibility The following workaround will help: var event = jQuery.Event('change'); event.currentTarget = = parent[0]; parent.trigger(event); but anyway it seems like jQuerry bug. Event.currenttarget Not Working In Firefox Therefore, if you can't find a way to bind the events such that you get the correct element in target/srcElement, you could try adding a class to the element that you

Clicking on one of the -tags calls the function sTt(fuEvent), which should show the id of the

-tag. I'm just going to copy this all wholesale from the docs, as a reference here. With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more. Why is the 'You talking to me' speech from the movie 'Taxi Driver' so famous? Not Working In Ie

Dev centers Windows Office Visual Studio Microsoft Azure More... share|improve this answer answered Feb 16 '11 at 19:26 alvincrespo 3,52293750 2 Reference for srcElement: –alvincrespo Feb 16 '11 at 20:13 4 Useful but incomplete. But it doesn't work. Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you!

How to prove that authentication system works, and that the customer is using the wrong password? Javascript Event Currenttarget event.currentTarget is something else and is more difficult to normalize. –David Aug 30 '11 at 15:36 2 Looks like @David is right, see the end of –Marc-André Lafortune Sep share|improve this answer answered Mar 16 '11 at 15:05 Anas 211 add a comment| up vote 1 down vote I'm assuming that you're wanting to use the 'this' context because the

Standards information Document Object Model (DOM) Level 3 Events Specification, Section 4.1 Remarks The target property returns the element that originally received an event.

I have: = event.srcElement || element; a wrapper is passing the original registered "element" to my "fix()" method. You’ll be auto redirected in 1 second. Example: var intervalID = setTimeout(function() { myFunc("one", "two", "three"); }, 1000); Yet another possibility is to use function's bind. Srcelement Vs Target One solution to emulate the event.currentTarget feature is to wrap your handler in a function calling the handler using with the element as a first argument.

Any other opinions? One solution to emulate the event.currentTarget feature is to wrap your handler in a function calling the handler using with the element as a first argument. Reload to refresh your session. Uncomment different handlers, click on 'Run' and observe browser console (changing combo box values does not correctly replicates the problem).

In this model, there is no equivalent to event.currentTarget and this is the global object. I can only cite here. –Felix Kling Aug 8 '11 at 16:56 @user752854: Please see my update. –Felix Kling Aug 8 '11 at 17:02 | show 4 more target and srcElement refer to the element that triggered the event, not the element that handles it. –Felix Kling Aug 8 '11 at 16:41 srcElement and target both refer I want to know the what part of speech is this, the word 'fit' in this sentence Diagonalizability of matrix A Isn't AES-NI useless because now the key length need to

Please check your inbox to confirm your subscription. event.element.htm 700 Bytes Tobie Langel October 9th, 2008 @ 04:01 PM event.srcElement should never be null, so I guess that's what we should be fixing. Why? It also screws up the "load" and "error" events on images, // reporting the document as the target instead of the original image.

If the OP uses jQuery, he will be able to use event.currentTarget on IE 7/8, as per his request. –Marc-André Lafortune Feb 16 '11 at 15:45 2 I guess it Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. At event phase AT_TARGET, the currentTarget and target objects are the same object. Tobie Langel July 24th, 2009 @ 02:11 AM Tag changed from “, discuss, element, events, ie, needs_failing_test_case, needs_patch, needs_tests” to “, discuss, element, events, ie, needs_failing_test_case, needs_patch, needs_tests, section:dom” [not-tagged:"dom" tagged:"section:dom"

© Copyright 2017 All rights reserved.