Welcome Guest, Not a member yet? Register   Sign In
Image issue in Javascript in CI
#1

[eluser]mythilisubramanyam[/eluser]
I'm having a separate folder for image.
how to use these images from image folder in javascript, as javascript has a separate folder.
#2

[eluser]jayrulez[/eluser]
set the image location as a variable in javascript in your headers like

[removed]
var img_path = 'http://mydomain.com/app/images/';
[removed]

and in your javascripts where you use the images just use

<img src="'+img_path+'image.extension" alt="img text">
#3

[eluser]jayrulez[/eluser]
set the image location as a variable in javascript in your headers like

[script type="text/javascript"]
var img_path = 'http://mydomain.com/app/images/';
[/script]

and in your javascripts where you use the images just use

[img src="'+img_path+'image.extension" alt="img text"]

replace [ with &lt; and ] with &gt;




Theme © iAndrew 2016 - Forum software by © MyBB