Hi yall,
Just wondering what's better/proper coding when using images, is it better to code the full url,
mysite.com/images/image.jpg
or just use /images/image.jpg
or does it matter?
Hi yall,
Just wondering what's better/proper coding when using images, is it better to code the full url,
mysite.com/images/image.jpg
or just use /images/image.jpg
or does it matter?
Busy posted this at 11:31—23rd September 2005.
He has: 6,149 posts
Joined: May 2001
just folder and name as the full path makes the browser pop out of your domain and back in again which slows the loading down by nano seconds (hey thats a lot if your a nano or something).
Another reason not to use the full path is if you ever change domain names and/or web hosts (and it happens), having used the full path you'd have to edit every single mention of it in every single one of your sites pages, where as just using the folder/name option doesn't require any changes, unless of course you change the folder name.
<?bhb if(broken){ echo("It wasn't me
"); } ?>
Learn HTML the ez way - EzHTML.net
Some people are like slinkies, they dont really serve any purpose but they still bring a smile to your face when you push them down the stairs ...
Anita.Bonghit posted this at 20:20—25th September 2005.
They have: 43 posts
Joined: Sep 2005
Thanks, makes perfect sense! Especially about changing domains - my site will eventually have hundreds of manually created pages by different people, so there wouldn't be an easy way to edit all of them to reflect a new file structure, or new domain either. Thanks Busy
Oh and I gotta quick question: should I include a slash in front of the images folder name?
-or-
mscreashuns posted this at 20:28—25th September 2005.
He has: 560 posts
Joined: Jul 2005
It's only necessary to include a slash in front of the folder name if the file you are editing is not in the root folder of your website.
Also, you have to make sure, when you do that, that your images folder is in the root folder. (e.g. http://yoursite.com/images)
Anita.Bonghit posted this at 20:44—25th September 2005.
They have: 43 posts
Joined: Sep 2005
Oh, I didn't know that - thanks mscreashuns.