• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 866
  • Last Modified:

Trouble finding correct path to images

Hi experts

While i was creating my website i used some javascript to create some revolving images in a div, the code below just grabs one image at a time from my images folder which is then displayed it in the div:

["http://localhost:54367/newwebsite/images/ResCloud.jpg", "", "", ""],
["http://localhost:54367/newwebsite/images/ResMount St Michelle.jpg", "", "", ""],
["http://localhost:54367/newwebsite/images/WHS2.jpg", "", "", ""],["http://localhost:54367/newwebsite/images/WHS3.jpg", "", "", ""]

I have now uploaded my website and i am testing it, now i need to change the path to the images in the images folder, the web-servers ip address is 94.136.40.75 and lets say my websites url is mywebsite.com does anyone know what path to use now i have uploaded my website?
0
dizzycat
Asked:
dizzycat
3 Solutions
 
sjklein42Commented:
If the images are in a subfolder directly under the folder containing your main HTML page, this should do it.  Remember, paths are relative to the "current" web page so you don't need to repeat the IP address or anything like that.

["images/ResCloud.jpg", "", "", ""],
["images/ResMount St Michelle.jpg", "", "", ""],
["images/WHS2.jpg", "", "", ""],
["images/WHS3.jpg", "", "", ""]

Open in new window

0
 
sjklein42Commented:
The same code should also work when you test it locally.
0
 
Paul JacksonCommented:
If you change to a relative path you shouldn't have a problem.
So the relative path would be like : ~/images/ResCloud.jpg
The ~ tells it to start at the website root level.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ludofulopCommented:
i'm not sure what are you asking, but probably you just need to use path withou domain name, e.g. /images/ResCloud.jpg, etc.  (assuming that "images" folder  is placed in root of mywebsite.com domain.
0
 
dizzycatAuthor Commented:
This is driving me nuts, i have tried

["images/ResCloud.jpg", "", "", ""],

and

["~/images/ResCloud.jpg", "", "", ""],

and

["/images/ResCloud.jpg", "", "", ""],

but none of them work.
0
 
sjklein42Commented:
From a browser, can you fetch the image directly? Maybe it isn't really where you think it is:
http://mywebsite.com/images/ResCloud.jpg

Open in new window

0
 
BurniePCommented:
Maybe you need to specify the website also, like you were doing locally.

["newwebsite/images/ResCloud.jpg", "", "", ""],

0
 
dizzycatAuthor Commented:
After all that, it seems that there is some kind of problem with the images i am using, i tried the below code with a different image and everything works:

["images/cloud1.jpg", "", "", ""],

Thanks for all your help gentlemen.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now