Like .

 
Tranel: Hi all, i’m stuck with my click listener and an ajax call here https://jsfiddle.net/15g7beza/ . can someone explain me an other way to proceed ?

Peden: DFar: unbind is pre jQuery 1.7

Dieringer: They use on and off now

Ruopp: DFar: https://jsfiddle.net/15g7beza/1/

Holzmiller: Urquidez: Ok, i’m ready something about that

Raw: So, there is no need to execute the .on after the “append”, i’m right ?

Calvano: Well it depends what element you place your click handler on

Popescu: By “execute .on” i mean ‘attach an event listener’ or something like that

Bispham: And if you delage the event properly always mix up delagte and defer but i think it delegate on events

Naqvi: If you want the event to trigger on a element you added after the ready call then you need to attach your lisener to a parrent that is present on page load

Dingle: Ok, as in my example, this parent is already on page, so there’s no need to attach to a parent

Osterhoudt: Now i’m understand better the .on and the delegating system

Robson: DFar: no. dynamically created elements bindings need to be attached to the pre-existing parent. like: $parent.on’click’, ‘dynamically createde child’, function{};

Muggeo: DFar: and you might wanna be carefull with returning false from event handlers

Pitfield: It can do strange thing to your delegation chain

Brixner: Ok, it’s just what i’m doing right now with .on and not with .unbind and it works fine

Rathgeb: What was the unbind for anyways?

Cobbs: Urquidez: how can i test a ‘return false’ from event handlers ? in order to prevent strange comportment ?

Picciuto: The usall answer in here is don’t do it

Nuzum: DFar: do you need to have it retun false?

Derr: Uhkis: For open a Lightbox with dynamic content created after the page is full loaded

Weith: Urquidez : You mean, i should delete the “return false;” line in my code ?

Oleksa: If you don’t think uou need it I would recomend doing that yes

Laframboise: Understood, I don’t need it, it will be commented now, thank you

Ballowe: I need to find child elements that have a certain attribute . .but the attribute may vary. I have tried: $’.tree li:hasul’.find”data-menu=’notInstalled'”,”data-menu=’outOfSync'” , but it obviously doesn’t work. What’s the correct syntax?

Pillado: See you later, and thank you again

Tango: Ballowe: collect all potential children and then filter

Tango: Also find’sel1,sel1′ works just fine

Tango: It’s a single argument separated by comma not separate arguments

Ballowe: Decx, so .find”name=’test’,name=’test2′”; is valid ?

Tango: Find’name=test, name=test2′ would be tho

Bassi: Hello there. If I load select to a page dinamically, and later try to get selected option value, It returns me allways val of selected element which was loaded before. Why when I change option it still returns me an old selected value?

Skafidas: Does anyone know how I would get the target from a node https://developer.mozilla.org/en-US/docs/Web/API/Node ?

Lukaszewski: Similar to event.target?

Quaife: Bongjovi: event.target is a node

Kallestad: Oh, so with jquery I could do $node ?

Michalczik: Or rather $ev.target === $’#my-id’

Tibbert: In any case, console.log is your friend

Tanksley: In my case it’s $’#my-id’.mouseupfunction{ $do***ent.getSelection.anchornode };

Dipaola: As I’m using do***ent.getSelection to grab highlighted text

Torp: Thanks, seems to work

Borris: I hadn’t realized event.target was a node

Difebbo: Jquery doesn’t have a nth-match selector in the core, does it?

Blasen: Like .my-cl***:nth-matcheven matches every other item with cl*** my-cl***