reference file from javascript. Path fix
===

perhaps this is a dummy question but... I have a file that ask for a image and it works just fine. The problem is when I link the javascript file from other directory. The path to the file goes relative to the current file and not to the javscript file it self. Whats my error there? can't?

Thanks in advance.

Directories:

    /
    --css
    --js
        --file.js
    --imagenes
        --close.png
   index.html

If I link the image in file.js and it in index.html I'd have to call


        this.img = $('<img>');
        this.img.attr('src', 'imagenes/close.png');
        this.div.append(this.img);

If I move the Index.html I can't refer that image again.