/    Sign up×
Community /Pin to ProfileBookmark

Havn’t got a clue how?

HI guys,
I am the webmaster of the mini car club of NSW [url]www.miniclub.com.au[/url]
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
Aaron

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@jochemDec 17.2003 — Place 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 ="path/to/folder/MenuCode.js"></script>.

Cheers, Jochem ?
Copy linkTweet thisAlerts:
@aruigauthorDec 17.2003 — 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

www.miniclub.com.au/main2.htm

tell me how dumb i am, i know it is something very straight forward.

Cheers

Aaron
Copy linkTweet thisAlerts:
@TomDenverDec 17.2003 — This is the first part of your code:
[code=php]
<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 ="/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">
[/code]


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:

[code=php]
<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 ="/MenuCode.js"></script>
</head>
<BODY CLASS="back">
[/code]


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.
Copy linkTweet thisAlerts:
@aruigauthorDec 17.2003 — 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,

www.miniclub.com.au/main2.htm

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


--------------------
Copy linkTweet thisAlerts:
@aruigauthorDec 17.2003 — I cant seem to place all the file on this post but the file is at

www.miniclub.com.au/MenuCode.js
Copy linkTweet thisAlerts:
@jochemDec 17.2003 — I 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 [color=red]red[/color]. 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="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 http://www.w3.org/TR/REC-html40/struct/global.html and http://www.w3schools.com.

Cheers, Jochem ?<i>
</i>
[color=red]&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;[/color]
&lt;html&gt;
&lt;head&gt;
&lt;meta name="GENERATOR" content="Microsoft FrontPage 5.0"&gt;
&lt;meta name="ProgId" content="FrontPage.Editor.Document"&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=[color=red]iso-8859-1[/color]"&gt;
[color=red]&lt;meta http-equiv="content-script-type" content="text/javascript"&gt;
&lt;meta http-equiv="content-style-type" content="text/css"&gt;[/color]

&lt;title&gt;New Page 1&lt;/title&gt;

[color=red]&lt;script language="JavaScript" src ="MenuCode.js"&gt;&lt;/script&gt;
&lt;base target="_self"&gt;[/color]

&lt;style type="text/css"&gt;
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;
[color=red]font :10pt Verdana, Arial;
color :#ffffff;
text-align :justify;
background-color :#000000;
background-image :url[/color] ('images/doris.gif') no-repeat fixed [color=red]0px[/color] 30%;}
[color=red]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;} [/color]
&lt;/[color=red]style[/color]&gt;

&lt;/head&gt;

[color=red]&lt;body&gt;[/color]
Copy linkTweet thisAlerts:
@Paul_JrDec 17.2003 — [URL]http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.1[/URL]
×

Success!

Help @aruig spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...