I Have done this now but still not working.
I have created a file called javacode.js and put my javascript in there.
The file starts
<script language="JavaS cript">
<!--
Javascript functions here
//-->
</script>
I have then got my html page below which starts as shown. Is that the right
place to put the script type?
<html>
<head>
<title>Page Title</title>
<meta>
<link rel="stylesheet " type="text/css" href="main.css" >
<script type="text/javascript" src="javacode.j s"></script>
</head>
<body>
My javascript works fine if I put it directly onto the page in place of the
one include line.
Thanks for your help so far.
Regards
"McKirahan" <Ne**@McKirahan .com> wrote in message
news:Mp******** ************@co mcast.com...
"Jamie" <ja**********@h otmail.com> wrote in message
news:fw******** ******@newsfe5-win.ntli.net... Hi there,
I have a bit of java script which I would like to include in all of my
html pages.
Is there an easy way to include it with a reference or something.
I don't want to have to copy and paste the code to the top of each page
as
if I then change the code I have to go through all pages to change it.
Any help would be appreciated.
I don't know a great deal about javascript or html but know a fair bit
about other programming languages.
Thanks in advance
--
Jamie Allison
Sheffield Hallam University
Software Engineering
Final Year
Place the JavaScript code in a file (e.g. "yourfile.j s") then use:
<script type="text/javascript" src="yourfile.j s"></script>
in the <head> section of your Web page.