PDA

View Full Version : Img Paths once FTP'd



Rich B
07-10-2009, 12:00 PM
Script: Text and Image Crawler
http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm

I added this great little script to my site and it worked perfectly (locally), previews correctly in Frontpage and previews correctly in any Browser.

However when i FTP the page up to the hosted server and make the page live on my website none of the images (img src="") show. Theres just a gap where they would be. The ticker tape text does display still.

Im assuming its due to it being unable to resolve the image paths once on the hosted server? I made sure i put the images in the same directory as the rest of the website (the crawler.js is also in the same dir).

code below:


<head>
<script type="text/javascript" src="crawler.js">
/*
Text and/or Image Crawler Script 2009 John Davenport Scheuer
as first seen in http://www.dynamicdrive.com/forums/ username: jscheuer1
This Notice Must Remain for Legal Use
*/
</script>



<div class="marquee" id="mycrawler2">
<img src="surgery2.jpg" width="208" height="155" />
<img src="surgery3.jpg" width="208" height="155" />
<img src="surgery.jpg" width="208" height="155" />
<img src="newwait.jpg" width="208" height="155" />
<img src="niallsrm.jpg" width="208" height="155" />
<img src="prem.jpg" width="208" height="155" />
<img src="ebroom.jpg" width="208" height="155" />

</div>

<script type="text/javascript">
marqueeInit({
uniqueid: 'mycrawler2',
style: {
'padding': '2px',
'width': '600px',
'height': '162px'
},
inc: 5, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 1,
neutral: 150,
savedirection: true
});
</script>

<div class="marquee" id="mycrawler">
* ticker text goes here. *
</div>

<script type="text/javascript">
marqueeInit({
uniqueid: 'mycrawler',
style: {
'padding': '5px',
'width': '600px',
'background': 'lightyellow',
'border': '1px solid #CC3300'
},
inc: 8, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 150,
savedirection: true
});
</script>

I tried right clicking the images in my hosted htdocs folder to get the full path but it doesnt give it me, assuming its the full path i need? how do i find it please??

ddadmin
07-11-2009, 04:56 PM
Have you simply tried changing the image srcs so they are absolute URLs, ie:


<img src="http://mysite.com/images/surgery2.jpg" width="208" height="155" />

Rich B
07-13-2009, 01:28 PM
i havent as im not sure what the correct url would be and i dont know if linking it that way might increase the page load time?
Im pretty sure someone else must've come across the same issue but i cant find anything using the search button so far.

ddadmin
07-14-2009, 02:37 AM
i havent as im not sure what the correct url would be and i dont know if linking it that way might increase the page load time?
Im pretty sure someone else must've come across the same issue but i cant find anything using the search button so far.

Using absolute URLs shouldn't affect page load times at all. As far as the correct URL, that would simply be the full URL to the images you wish to show inside the Crawler, such as http://mysite.com/images/surgery2.jpg

Rich B
07-14-2009, 10:28 AM
ill give it a try, although it does mean testing it on the live site.

Rich B
07-14-2009, 10:37 AM
no, linking them using http://www.mywebsite.com/images/surgery2.jpg or http://www.mywebsite.com/surgery2.jpg does not work either?

ddadmin
07-14-2009, 08:32 PM
Just in case you missed it, you did remember to substitute "mywebsite.com" in the image URLs with your actual domain right?

Rich B
07-15-2009, 08:08 AM
yes thanks

Rich B
07-15-2009, 08:30 AM
well i never knew that!
i tried just calling already known and used images from the browser like http://www.mywebsite.com/knowntoworkimage.jpg and then tried calling the new images i wanted in the crawler like http://www.mywebsite.com/surgery2.jpg.

The known ones displayed as expected the NEW images did not. For some reason when i resized the images in paint (i didnt have access to my photoshop pc at the time) it changed the file extensions from "jpg" to "JPG"

My script wasnt finding the images because the extensions were uppercase.

Its working now, many thanks for your input as it guided me towards finding the problem.
(dynamicdrive link added in thanks)