Ziele / Targets von JQuery events benutzen

Da ich nun schon einige Zeit nach einer entsprechenden Lösung gesucht habe, möchte ich euch hier kurz mitteilen, wie man die Zielelemente von Events anspricht!

Darüber ist es z.B. auch global möglich die Zielelemente von Ajax-Anfragen per ajaxSucces(eventObj, ..., ...){} anzusprechen.

Um also die Zielelemente zu bekommen (z.B. für Manipulationen oder Re-Initialisierungen), sprecht dieses in der folgenden Weise an:

JQuery:

function performAction(){
$(document).ajaxSuccess(function(evt, request, settings){
performActionOnDomObject(evt.target);
}
});

Der Post, welcher mich auf die entsprechende Idee gebracht hat (vorher bin ich leider aufgrund falscher Schreibweise gescheitert) ist hier zu finden:
http://stackoverflow.com/questions/153934/how-do-i-reference-the-calling...

Trackback URL for this post:

http://julian.pustkuchen.com/en/trackback/36

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><blockquote>
  • Lines and paragraphs break automatically.
  • Pairs of<blockquote> tags will be styled as a block that indicates a quotation.
  • You can enable syntax highlighting of source code with the following tags: <c>, <cpp>, <css>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <smarty>, <xml>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.