Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images not loading 1st time? 4

Status
Not open for further replies.

ClulessChris

IS-IT--Management
Jan 27, 2003
890
GB
It seems that each day I've new question to post (sorry).

This is my first time publishing a website, and I've tried to follow best practice. after a few weeks of learning and asking quetions I've got the site off the ground (
I've got one more question to ask (for the moment).

The first time it load the home page no images are loaded, however if i move to another page o the site and back to home, the images load fine.
How can I ensure they load 1st time?

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
 
The error is in the URLs.
I guess you have written the site on your local computer.
On the server, URLs are case-sensitive and on the "1st" page you have URLs like "Images/[red]m[/red]isc/logo_red_lrg.jpg". But on the server the URL is "Images/[red]M[/red]isc/logo_red_lrg.jpg"

I use to have ALL files on my server with lowercase names so this problem never occurs..

Change these URLs and it will work just fine.

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Many thanks to you both.
Yes i wrote it on the local domain, and I'd thought I'd fixed the case sensitive url issue.
All good fun this ain't.
How come althoght I fixed the url's on the local copy of this page and uploaded the file, it didn't seem to take the change on the web server?

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Well, it's best to allways save all files in lowercase. Also all folders on the server. It also look better since URLs on the internet are all in lowercase.. :p

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Lowet, thanks once again for the tip. I'll adopt this practice.

I notice that when test with fire the online version is broken in seem not to see any linked css or js files.
this worked fine in the local domain, could this be anthoer basic slip up on my part?

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Hmm.. There is no problems viewing the site now.. All CSS/JS and pics are loaded..
What do you mean?

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Ok, here's another set of tips:

1. Your js and css use backslash instead of slash. While backslashes will sometimes work (especially on IE), they are much less reliable than slashes. Therefore, always use slashes in the URLs.

2. A space in the URL is encoded as a %20 sign. If you want to have spaces in your folders on the server, this is how you will need to address them in the URLs (Scripts%20and%Styles). That is a bit too complex and you're much better off if you avoid spaces in the files and folders of the files on the internet (e.g. scripts_stlyes).

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Exactly, Vragabond.
Allways use underscore instead of spaces in files/folders. And also backslashes may be used in serverside scripting but to be avoided in HTML..
I gave you a star for that tip, Vragabond.

Also it's a good practice to decide to use either uppercase or lowercase (preferred) in the HTML tags. Your code contains a mix of both. [tt]<Body onLoad="...">[/tt] doesn't look professional. :p Well, it's not critical, just a tip..

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Lowet / Vragabond,
Many thanks to you both. this has been one of the more usefull threads I've had for some time.

On adapting all the practices mentioned above, I now have to tackle the 1 browser I've only today been able to test in (IE6). This will no doubt be the subject of a later thread(s), and I can only hope to get this much out of it.

regards.

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
It's a good practice to test your code in different broswers. I have Firefox, Mozilla, K-Melon, Netscape, Internet Explorer, Opera, MSN Explorer and Lynx in many versions to test my code in. You don't have to get all these but it's good to have a Internet Explorer, a Netscape, an Opera and a Firefox installed on your machine to test your code.
One ennoying thing when browsering the internet is when a site is only supported by one browser.. Keep that in mind.

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
Since Netscape (which is not going to be developed further, from what I've read) and Firefox use the same Mozilla engine, you should get the same results testing in Firefox as Netscape. IE and Firefox make up the largest number of browsers in use today, with Opera and Safari (with Mac users) somewhere after that.

You can take a look at your website statistics to see what your visitors are using, and then decide what to do for the ones that are less used.

Lee
 
Well, there is some differences between them all. But if you just want to check if you page is supported by browsers you should try it in browsers with different engines like gecko etc.. also internet exoplorer uses different engines for the WIN and MAC versions.. But this is not for novices. Not everyone has a MAC and a PC.. :p

- Lowet

[gray]Why can't all browsers parse pages the same way? It should be the Web designer who decides how to display the content, not the browser![/gray]
 
I have checked the site with Firefox (and netscape although i had read the advice given by trollacious else where and now just test with Firefox), Opera, Safari, IE7.
But did not have a machine with an earlier version of IE.

I've since found a machine in the office that has IE6, and found that I have some bug fixing to do for that browser.

I think it would be hugely ambitious of me to try to cater for all browsers, so if I can cater for 90% I’ll be a happy man.

Many thanks for all your help in this thread, I'm now off to hunt the beast that is a fix for fixed positioning in IE6.

Regards
Chris

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top