Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-03-2004, 02:27 PM   PM User | #1
Avik
New to the CF scene

 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Avik is an unknown quantity at this point
Using a shared html on website

Hi,

My website has a top navigation bar with graphics and javascript codings - it weights about 60K.
I want to save it to a separate file in a way that every page can load it at the top, without using a frameset.
By doing that I hope to:
A. Allow browsers to cache the nav bar seperately = reduce loading time.
B. Update only one single file when necessary.

Is there some HTML technique for doing so?

Thanks,
Avik
Avik is offline   Reply With Quote
Old 01-03-2004, 02:48 PM   PM User | #2
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
Images are cached separately, however if your navbar alone without images is 60K there is something terribly wrong with your code. While generally making your navigation depend on javascript is bad idea, you can put your script in a separate file which will also be cached on the first visit.
__________________
Vladdy | KL
"Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"
Vladdy is offline   Reply With Quote
Old 01-03-2004, 04:49 PM   PM User | #3
Skyzyx
Regular Coder

 
Skyzyx's Avatar
 
Join Date: Aug 2002
Location: Silicon Valley, CA
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
Skyzyx is on a distinguished road
If you're going to do this, a server-side language would be the best way. Personally, I use PHP. I create a function that writes each line of code I need, and save it as a central library of sorts. On my individual pages, I simply load the library and call the function. This way, the processing doesn't depend on the user's computer... which is a drawback of using JavaScript, however, it can be done using the same ideas.

Requiring JavaScript just to have the page work introduces a flurry of accessibility, compatibility, and validation problems. Although it's possible to use JavaScript to do this, it is definitely not recommended.
__________________

Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.
Skyzyx is offline   Reply With Quote
Old 01-03-2004, 05:04 PM   PM User | #4
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,042
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
You could also use shtml instead of php if you just need the include functionality.
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:06 PM.


Advertisement
Log in to turn off these ads.