PDA

View Full Version : How do I... HTML/CSS and javascript people please.?


Nelle
10-03-2009, 08:59 PM
So I'm designing and coding a website that has several pages. When I am updating the navigation, header, or footer I would like the changes to appear on all the web pages so I don't have to manually update every page.

How do I call the html/css of the header and navigation from a different file?

Angus Fretwell
10-03-2009, 10:00 PM
I did this once using php, essentially just use:
Put the navigation HTML/CSS in 'file.php'.

Try that, you might have to fiddle around a bit...

Socrates
10-03-2009, 10:59 PM
The best way to do this would be to use some sort of server side scripting like ASP.net, PHP, Coldfusion, ect. Another technology to learn!

However, another way is to use HTML frames. Your navigation, header or footer would be its own HTML document, called by a frame. Any changes show up everywhere. If you need to customize the page look depending on who or what page calls it, you can pass a query string to it. Look at the address of some web pages. Anything following the question mark is a query string. You can pass stuff to your web pages this way. Javascript on the page reads the string and does something.