I Moodle I can associate an image with PHP something like:
$OUTPUT->pix_url('t/backup')
Which on my machine turns into 'http://localhost/moodle26/theme/image.php/standard/core/1395409220/t/backup'.
If I wanted to get the same path from JavaScript is there a utility method in the 'M' namespace that I can use or should I just copy the images to a known location and use a hardcoded value for the path?