image files from javascript |
Greetings,
I'm continuing some existing projects referencing images via Javascript files e.g. var images=["<img src='/images/chicken.png'>","<img src='[b]/images/pig.png'>"][/b] Is it possible to reference these directly from Javascript files located in the assets folder i.e. C:\xampp\htdocs\game\assets\images just for demo purposes, not best practice. Cheers
Always use the base_url() setting:
Code: <img src="<?= base_url('assets/images/pig.png');?>" />
hey @Wouter60,
thanks for your suggestion. i was also looking for a for the same. your response was helpful for me. best regards!!
|
Welcome Guest, Not a member yet? Register Sign In |