How to use Code Igniter to show Dynamic images via javascript(jQuery).
Posted
by aaroninfidel
on Stack Overflow
See other posts from Stack Overflow
or by aaroninfidel
Published on 2010-03-24T22:00:09Z
Indexed on
2010/03/24
22:03 UTC
Read the original article
Hit count: 249
You can use the URL helper in Code Igniter to load CSS and Javascript with the base_url() method, but what if you have images dynamically being placed into your HTML via javascript? for example in my javascript file I've got
var arrowimages={down:['downarrowclass', 'images/down.png', 23], right:['rightarrowclass', 'images/right.png']}
and those images will be placed into whatever menu item I've specified has a drop down menu.
but that file is a .js file so obviously the server won't load php inside of it.
so, how can I set the base url for the JS?
Thanks!
-Aaron
© Stack Overflow or respective owner