2013-03-13, 08:52:44
(This post was last modified: 2013-03-13, 09:10:17 by kennylovesyou.)
Apologies if I've posted this in the wrong board.
I'm looking for some information on how I can use GSCMS functions inside a js file.
My js file is located within mytheme:
gscms
-theme
--mytheme
--myfile.js
---assets
----images
-----picture.jpg
Currently I'm trying to load an image inside my js file which references the image as "/assets/images/picture.jpg"
The problem is that the paths inside js aren't relative to the file location but the page loaded.
ie. GSCMS tries to load "siteurl/assets/images/picture.jpg" instead of "siteurl/theme/themefolder/assets/images/picture.jpg"
My question is, is it possible to include the <?php get_theme_url(); ?> function inside a js file?
Has anyone every tried this?
I'm looking for some information on how I can use GSCMS functions inside a js file.
My js file is located within mytheme:
gscms
-theme
--mytheme
--myfile.js
---assets
----images
-----picture.jpg
Currently I'm trying to load an image inside my js file which references the image as "/assets/images/picture.jpg"
The problem is that the paths inside js aren't relative to the file location but the page loaded.
ie. GSCMS tries to load "siteurl/assets/images/picture.jpg" instead of "siteurl/theme/themefolder/assets/images/picture.jpg"
My question is, is it possible to include the <?php get_theme_url(); ?> function inside a js file?
Has anyone every tried this?