ajaxSend is a global event that *every* bound listener will pick up.
You're binding listeners to all the elements that you *could* click on
to initiate the ajax call, but the ajax call does not know (or care)
what was clicked on, it just knows it has something to send.
You must have click event
I found a better solution that solves my problemo. You see the whole
idea of programming well is doing every thing once. DRY is the
principal that describes this. If I were to do it the way you
suggested Wizzud, it would mean having $(this).replaceWith('img
src=path/to/img.gif');
I used
ok, after that speech on DRY. I noticed your code said $('.control')
lol. Call me stupid.
I am going to stick with my solution I posted previously so I can use
it for things that don't have a class of control
But If I were to implement your solution I would do it like this: (if
you had something
I realize this is possible. But, like the title of this message
suggests, I don't to put the logic to replace the image for each
event. I will end up with more than 100 events on this page.
If I could have the elements being replaced by ajax, first replaced
with the wait image automatically when
4 matches
Mail list logo