Adding a path inside a JS file within a package
Permalink
I'm building a simple responsive gallery plugin using JordanLev's great boilerplate as a start point and a great
It's up for review & one of the things that it's falling down on is a 404 for an ajax-loader.gif file for when the images are loading.
I've searched the forums and everything I'm seeing relates to setting a path within your PHP file and references the javascript within the script tag on the page rather than in a js file within a package.
I've cheated & hard coded this:
into the JS file. Is there a best practice way to do this or is there a C5 snippet like getthemepath that allows you to reference the image in the folder within a package without hardcoding the full path?
It's up for review & one of the things that it's falling down on is a 404 for an ajax-loader.gif file for when the images are loading.
I've searched the forums and everything I'm seeing relates to setting a path within your PHP file and references the javascript within the script tag on the page rather than in a js file within a package.
I've cheated & hard coded this:
sbImg = $('<img src="../packages/c5tt_gallery/blocks/c5tt_gallery/img/ajax-loader.gif" class="gallery-current-img"/>'),
into the JS file. Is there a best practice way to do this or is there a C5 snippet like getthemepath that allows you to reference the image in the folder within a package without hardcoding the full path?