And that's why Ariel is da man! Nice one.

--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jun 12, 2008, at 7:09 AM, Ariel Flesler wrote:


Ooooooor....

var fileName = $('img').attr('src').split('/').pop();

Cheers :)

--
Ariel Flesler
http://flesler.blogspot.com/


On 11 jun, 22:29, Karl Swedberg <[EMAIL PROTECTED]> wrote:
Hi there,

You could do it like this:

var path = $('img').attr('src');
var fileName = path.slice(path.lastIndexOf('/')+1);

--Karl
____________
Karl Swedbergwww.englishrules.comwww.learningjquery.com

On Jun 11, 2008, at 7:36 PM, yo2lux wrote:





path variable store the following: /themes/mytheme/images/logo.gif:

var path = $('img').attr('src');

is possible to obtain the image name without path ? I need logo.gif
I need a Javascript or jQuery function to solve this?

Thanks!- Ocultar texto de la cita -

- Mostrar texto de la cita -

Reply via email to