HI guys,
I am the webmaster of the mini car club of NSW <!-- w --><a class="postlink" href="http://www.miniclub.com.au">www.miniclub.com.au</a><!-- w -->
At the moment our site which is all non profit is quite slow in the way i have built it. i have a javascript menu that is around 30k in size and this is built into each individual page. No my question is, can i remove this and make it a css or a js file so that it loads once rather than over and over with every new page. I built it with hotdog menu builder and that will probably explain to you my lack of knowledge when it comes to anything but HTML. Any assistance would be appreciated.
Cheers
AaronPlace your JavaScript code in an external document named "MenuCode.js". In that document, leave out the <script></script> tags. Then refer to it from the <head> section of each page that needs to have the menu displayed with
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"path/to/folder/MenuCode.js"></script>.
Cheers, Jochem Thanks for that, i have copied it out and pasted it into a text file and named it MenuCode.js. Also put the line of code in but it didn't seem to work.
I have popped a work in progress page up
<!-- w --><a class="postlink" href="http://www.miniclub.com.au/main2.htm">www.miniclub.com.au/main2.htm</a><!-- w -->
tell me how dumb i am, i know it is something very straight forward.
Cheers
AaronThis is the first part of your code:
<html>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Mini Car Club NSW</title>
<base target="_self">
<style>
body{
scrollbar-arrow-color: #FF0000;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #DFDBCC;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #797566;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
</style>
<style>
body{
scrollbar-arrow-color: #FF0000;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #DFDBCC;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #797566;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
</style>
<STYLE TYPE="text/css">
BODY.back {background: url('images/doris.gif')
Black 0% 30% no-repeat fixed}
</STYLE>
<head>
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"/MenuCode.js"></script>
<BODY CLASS="back">
</head>
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<body bgcolor="#000000">
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<head>
</head>
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<body bgcolor="#000000">
There's several HTML errors and things in the wrong places. I won't detail each one. There should only be one <head> and one <body> tag (and really only need one <style> tag but having more won't break it), you have several of each. Also, all <style>, and <meta> (and in this example, your <script> tag as well, but that's not the rule for all <script> tags) tags should be inside of a <head> tag, and the <body> tag must be outside of the <head> tag. Try this code instead:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Mini Car Club NSW</title>
<style>
body{
scrollbar-arrow-color: #FF0000;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #DFDBCC;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #797566;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
BODY.back {background: url('images/doris.gif')
Black 0% 30% no-repeat fixed}
</STYLE>
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"/MenuCode.js"></script>
</head>
<BODY CLASS="back">
I have not tested this, but your <script> tag was not inside of the <head> tag, which I'm pretty sure is what caused it to not work.Thanks again. I had started to clean up all the rubbish in the header, i guess thats what you get from relying on frontpage! I should do things properly! As you would see on the site,
<!-- w --><a class="postlink" href="http://www.miniclub.com.au/main2.htm">www.miniclub.com.au/main2.htm</a><!-- w -->
i have tidied up the header and all seems well. but still no luck....
below is the text in the MenuCode.js file
i don't really understand how it works so again any assistance is greatful!
Cheers
Aaron
--------------------I cant seem to place all the file on this post but the file is at
<!-- w --><a class="postlink" href="http://www.miniclub.com.au/MenuCode.jsI">www.miniclub.com.au/MenuCode.jsI</a><!-- w --> found quite some more errors in your page so I decided to revise at least part of it: the <head> section. All changes that I made are in red. I did not find the time to revise the rest of your page.
Since your stylesheet is repeated in all of your pages, you might want to place that into an external file too, just like the MenuCode.js file. If you wish to do that, place it in a file named StyleSheet.css. Leave out the <style></style> tags and refer to it from the <head> of your page like this:
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"path/to/file/StyleSheet.css">.
I think you should try to learn more about the basics of HTML programming. Two good sites to check out are <!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/struct/global.html">http://www.w3.org/TR/REC-html40/struct/global.html</a><!-- m --> and <!-- m --><a class="postlink" href="http://www.w3schools.com">http://www.w3schools.com</a><!-- m -->.
Cheers, Jochem
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<title>New Page 1</title>
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"MenuCode.js"></script>
<base target="_self">
<style type="text/css">
body {
scrollbar-arrow-color :#FF0000;
scrollbar-3dlight-color :#333333;
scrollbar-highlight-color :#DFDBCC;
scrollbar-face-color :#000000;
scrollbar-shadow-color :#797566;
scrollbar-darkshadow-color:#000000;
scrollbar-track-color :#000000;
font :10pt Verdana, Arial;
color :#ffffff;
text-align :justify;
background-color :#000000;
background-image :url ('images/doris.gif') no-repeat fixed 0px 30%;}
a {
color :#ffffff;
text-decoration :underline;
font-weight :normal;}
a:hover {
color :#ff0000;
text-decoration :underline;
font-weight :normal;}
a:active {
color :#ffffff;
text-decoration :underline;
font-weight :normal;}
a:visited {
color :#ffffff;
text-decoration :underline;
font-weight :normal;}
</style>
</head>
<body>http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.1
I am the webmaster of the mini car club of NSW <!-- w --><a class="postlink" href="http://www.miniclub.com.au">www.miniclub.com.au</a><!-- w -->
At the moment our site which is all non profit is quite slow in the way i have built it. i have a javascript menu that is around 30k in size and this is built into each individual page. No my question is, can i remove this and make it a css or a js file so that it loads once rather than over and over with every new page. I built it with hotdog menu builder and that will probably explain to you my lack of knowledge when it comes to anything but HTML. Any assistance would be appreciated.
Cheers
AaronPlace your JavaScript code in an external document named "MenuCode.js". In that document, leave out the <script></script> tags. Then refer to it from the <head> section of each page that needs to have the menu displayed with
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"path/to/folder/MenuCode.js"></script>.
Cheers, Jochem Thanks for that, i have copied it out and pasted it into a text file and named it MenuCode.js. Also put the line of code in but it didn't seem to work.
I have popped a work in progress page up
<!-- w --><a class="postlink" href="http://www.miniclub.com.au/main2.htm">www.miniclub.com.au/main2.htm</a><!-- w -->
tell me how dumb i am, i know it is something very straight forward.
Cheers
AaronThis is the first part of your code:
<html>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Mini Car Club NSW</title>
<base target="_self">
<style>
body{
scrollbar-arrow-color: #FF0000;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #DFDBCC;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #797566;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
</style>
<style>
body{
scrollbar-arrow-color: #FF0000;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #DFDBCC;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #797566;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
</style>
<STYLE TYPE="text/css">
BODY.back {background: url('images/doris.gif')
Black 0% 30% no-repeat fixed}
</STYLE>
<head>
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"/MenuCode.js"></script>
<BODY CLASS="back">
</head>
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<body bgcolor="#000000">
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<head>
</head>
<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<body bgcolor="#000000">
There's several HTML errors and things in the wrong places. I won't detail each one. There should only be one <head> and one <body> tag (and really only need one <style> tag but having more won't break it), you have several of each. Also, all <style>, and <meta> (and in this example, your <script> tag as well, but that's not the rule for all <script> tags) tags should be inside of a <head> tag, and the <body> tag must be outside of the <head> tag. Try this code instead:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Mini Car Club NSW</title>
<style>
body{
scrollbar-arrow-color: #FF0000;
scrollbar-3dlight-color: #333333;
scrollbar-highlight-color: #DFDBCC;
scrollbar-face-color: #000000;
scrollbar-shadow-color: #797566;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #000000;
}
BODY.back {background: url('images/doris.gif')
Black 0% 30% no-repeat fixed}
</STYLE>
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"/MenuCode.js"></script>
</head>
<BODY CLASS="back">
I have not tested this, but your <script> tag was not inside of the <head> tag, which I'm pretty sure is what caused it to not work.Thanks again. I had started to clean up all the rubbish in the header, i guess thats what you get from relying on frontpage! I should do things properly! As you would see on the site,
<!-- w --><a class="postlink" href="http://www.miniclub.com.au/main2.htm">www.miniclub.com.au/main2.htm</a><!-- w -->
i have tidied up the header and all seems well. but still no luck....
below is the text in the MenuCode.js file
i don't really understand how it works so again any assistance is greatful!
Cheers
Aaron
--------------------I cant seem to place all the file on this post but the file is at
<!-- w --><a class="postlink" href="http://www.miniclub.com.au/MenuCode.jsI">www.miniclub.com.au/MenuCode.jsI</a><!-- w --> found quite some more errors in your page so I decided to revise at least part of it: the <head> section. All changes that I made are in red. I did not find the time to revise the rest of your page.
Since your stylesheet is repeated in all of your pages, you might want to place that into an external file too, just like the MenuCode.js file. If you wish to do that, place it in a file named StyleSheet.css. Leave out the <style></style> tags and refer to it from the <head> of your page like this:
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"path/to/file/StyleSheet.css">.
I think you should try to learn more about the basics of HTML programming. Two good sites to check out are <!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/struct/global.html">http://www.w3.org/TR/REC-html40/struct/global.html</a><!-- m --> and <!-- m --><a class="postlink" href="http://www.w3schools.com">http://www.w3schools.com</a><!-- m -->.
Cheers, Jochem
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<title>New Page 1</title>
<script language="JavaScript" src =http://www.webdeveloper.com/forum/archive/index.php/"MenuCode.js"></script>
<base target="_self">
<style type="text/css">
body {
scrollbar-arrow-color :#FF0000;
scrollbar-3dlight-color :#333333;
scrollbar-highlight-color :#DFDBCC;
scrollbar-face-color :#000000;
scrollbar-shadow-color :#797566;
scrollbar-darkshadow-color:#000000;
scrollbar-track-color :#000000;
font :10pt Verdana, Arial;
color :#ffffff;
text-align :justify;
background-color :#000000;
background-image :url ('images/doris.gif') no-repeat fixed 0px 30%;}
a {
color :#ffffff;
text-decoration :underline;
font-weight :normal;}
a:hover {
color :#ff0000;
text-decoration :underline;
font-weight :normal;}
a:active {
color :#ffffff;
text-decoration :underline;
font-weight :normal;}
a:visited {
color :#ffffff;
text-decoration :underline;
font-weight :normal;}
</style>
</head>
<body>http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.1