[jQuery] Re: How to grab the filename (src attribute) of an image?

2009-01-17 Thread jQuery Lover
Well, it depends where you need it... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 12, 2009 at 10:19 PM, webmas...@terradon.nl wrote: > > Where and how do i implement var fileName = $(this).attr('src'); >

[jQuery] Re: How to grab the filename (src attribute) of an image?

2009-01-12 Thread webmas...@terradon.nl
Thanks for the answers, i see some daylight now, but i already have a normal onclick event on the image, triggering my normal js function: squareClicked(row,col,isEmpty) { // my other normal js function // with jquery : showing message div // my jquery post to taconite plugin page, proces

[jQuery] Re: How to grab the filename (src attribute) of an image?

2009-01-12 Thread jQuery Lover
I believe he/she is binding an event with javascript not jquery's event binding. Webmaster you can refer to an element which was clicked with "this" keyword. So to get your image source just use "this.src" property. Example: The same when applying with event listeners... - Read j

[jQuery] Re: How to grab the filename (src attribute) of an image?

2009-01-12 Thread Mauricio (Maujor) Samy Silva
$('img').click(function() { var fileName = $(this).attr('src'); alert(fileName); }); MaurĂ­cio -Mensagem Original- De: Para: "jQuery (English)" Enviada em: segunda-feira, 12 de janeiro de 2009 10:59 Assunto: [jQuery] How to grab the filename (src attribute) of an image? Hi all, h