View Full Version : Shortcut with lots of pages?


beth205
08-11-2004, 04:04 PM
I have my css, and then here is my html for my page:

<html>
<head>

</script>
<title>title here</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>

<div id="blog">blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here blog here </div>
<div id="nav">navigation here navigation here navigation here navigation here navigation here navigation here navigation here navigation here navigation here navigation here navigation here navigation here </div>


</body>
</html>


For <div id="nav">content here</div> is there not a shortcut to use, that will allow me to update it easier, rather than copy and paste throughout all my pages? thanks

stargrl329
08-11-2004, 04:11 PM
Do you mean you want to automatically include it in each page? This can be done using PHP (http://htmlite.com/php039.php), SSI (http://lissaexplains.com/html6.shtml#SSI), or Javascript (http://javascript.about.com/library/weekly/aa102901a.htm) includes. The one you pick will depend on a) what your host supports, and b) what is most convenient for you and your site. :)

bourdelson
08-11-2004, 04:11 PM
You can use SSI or PHP includes.

http://www.lissaexplains.com/html6.shtml

Edit: Stargrl beat me. :p

beth205
08-11-2004, 04:26 PM
so All I need to do is this:

<div style="nav">
<script language="JavaScript" src="nav.js"></script>
</div>

nav.js being my file with the navigation content in.
I save the index file as .html???

beth205
08-11-2004, 04:39 PM
anyone?

stargrl329
08-11-2004, 04:42 PM
Yes, from what I read on the link I gave you, I believe that's how it works. And yes, you can leave the file extension as .html.

beth205
08-11-2004, 04:44 PM
okay thanks I'll get right to it

beth205
08-11-2004, 05:00 PM
oh... but something seems not to be working. Perhaps it is this bit:

Next, for simple HTML content you use the JavaScript document.write function to generate the HTML inline. For example, the following generates a copyright notice that could be placed at the bottom of every page:

document.write('<font size="2">Copyright 2001 Robert Dominy. All Rights Reserved</font>');

Note that in the external script file, you should not include script tags around your code like you would in an HTML document -- just enter your code directly.


I don't quite understand

beth205
08-11-2004, 06:04 PM
lol what about this:

<script language="JavaScript">
document.write('is this where I type my content? if so then where?');
</script>


Where does it come into the script about??

beth205
08-11-2004, 09:50 PM
please reply thanks!

pb&j
08-12-2004, 03:46 AM
document.write('is this where I type my content? if so then where?');
you would put this ^ in the javascript page.
yes, you type in your content in that spot, between the two single quotes.
and save it as your "nav.js" page.

then on your html page, do your call to it like you have posted before...
<div style="nav">
<script language="JavaScript" src="nav.js"></script>
</div>