Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Linking Images in Javascript.

I have a directory

html >
...... index.html
......Folder#inc >
...... Folder#Images
......Folder#Js >
......myfile.js

Inside this myfile.js I need to make a reference to images inside the Images folder, but I don't know how to do this. When I link it to /inc/Images/..etc.. It doesn't add the root directories.

So basically, I eventually want to run this on an android device. I don't know how to get file path for the images within the Javascript. At the moment my images are just linking towards /inc/images/.. instead of C://....../inc/images.

Kinda lost, thanks for any help.
You shuld post this in Javascript section and not here.
The JS file will use the images relative to where it's called from. If it's used in the index.html file then it seems your link structure is correct. However, if it's been called from the JS folder then you need to go back one directory: "../inc/Images"

It would probably help to see the actual javascript code though.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Help] by craigOwnsYouOct 9, 2019 08:53 AM 5 272 Oct 9, 2019 08:53 AM
Last Post: Deal
by M0therB0ardOct 7, 2017 04:05 PM 2 164 Oct 7, 2017 04:05 PM
Last Post: M0therB0ard
[Help] by MiarJun 8, 2017 06:16 AM 0 83 Jun 8, 2017 06:16 AM
Last Post: Miar