Solved

Trouble finding correct path to images

Posted on 2011-02-20
8
860 Views
Last Modified: 2012-05-11
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
Comment
Question by:dizzycat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 16

Expert Comment

by:sjklein42
ID: 34938650
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
 
LVL 16

Expert Comment

by:sjklein42
ID: 34938651
The same code should also work when you test it locally.
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 167 total points
ID: 34938653
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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 
LVL 15

Assisted Solution

by:ludofulop
ludofulop earned 166 total points
ID: 34938655
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
 

Author Comment

by:dizzycat
ID: 34938718
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
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 167 total points
ID: 34938754
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
 
LVL 16

Expert Comment

by:BurnieP
ID: 34938835
Maybe you need to specify the website also, like you were doing locally.

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

0
 

Author Closing Comment

by:dizzycat
ID: 34938888
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
problems with widget background image 9 35
How to open a new browser tab after executing php script 20 49
CSS styling problem 3 28
Why is my select returning NaN 23 40
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question