Welcome Guest, Not a member yet? Register   Sign In
Images files from javascript
#1

Greetings,

I'm continuing some existing projects referencing images via Javascript files e.g.
var images=["<img src='/images/chicken.png'>","<img src='/images/pig.png'>"]
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
Reply
#2

Did you tried to use an absolute route for your demo purposes?? You should.
Reply
#3

Use jQuery to Asynchronously Load an Image
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

var images = ["<img src='http://localhost/CodeIgniter/assets/images/chicken.jpg'>", "<img src ='http://localhost/CodeIgniter/assets/images/pig.png'>"];
Reply




Theme © iAndrew 2016 - Forum software by © MyBB