include file help

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Hi
I have a javascript file which creates a menu on a page. is it possible to
include this file instead of cutting and pasting the javascript code into
the page code
Thankyou

Paul M
 
Paul M said:
Hi
I have a javascript file which creates a menu on a page. is it possible to
include this file instead of cutting and pasting the javascript code into
the page code
Thankyou

Paul M

You need to put the script on each page as well, it won't work just putting
the code into the include page ... if your using frontpage 2003 this is easy
to do with a dwt (dynamic web template)

Tina


--
http://accessfp.net/ - FrontPage Tutorials
http://anyfrontpage.com/ - http://frontpage-ebooks.com/
http://addonfp.com/ - FrontPage Addons
http://frontpage-tips.com/ - Weekly FrontPage Tips
http://msmvps.com/frontpage/ - FrontPage News & Articles Blog
http://frontpage-advice.blogspot.com/ - FrontPage Advice Blog
http://artdoodle.com/ - Abstract Pen and Ink Drawings
 
yes....

<script language="javascript src="your/path/to/script.js">

the above is how to "include" a javascript. the script is written in a text
file with the extensions "js".
you need to still "call" the script via 'onclick', 'onmouseover' onload,
onunload etc - i.e. "an event" to make it do something.
 
by "include" do you mean a FrontPage "include content" web component?

can you show a link to a page with this script in it?

I almost always put things like this into pages via a FrontPage include
where possible because if I want to change the script I only have to edit it
in one place and FrontPage will re-write it into any page it's called by.

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
 
Hi Andrew Where do I put this code I
Paul M

Andrew said:
yes....

<script language="javascript src="your/path/to/script.js">

the above is how to "include" a javascript. the script is written in a
text file with the extensions "js".
you need to still "call" the script via 'onclick', 'onmouseover' onload,
onunload etc - i.e. "an event" to make it do something.
 
Hi
The page is not online yet. I created a navigation bar using a program
called coffee cup dhtml menu writer, you then copy the code into your page
code.
What I wish to know is if I save the created code in a javascript file
instead of pasting it into the page code is there a way to put somekind of
code in the web page that will call up the javascript file and create the
menu without having to paste the code directly into the web page

Thanks
Paul M
 
yes, you could either link an external JavaScript file to all your pages or
you can simply put the menu in a page by itself (with the JavaScript below
the opening body tag) and then include it into every page you want it in.

it's best to just make one single page that contains all your banner/ header
stuff (including this menu) then in FrontPage put it into your pages using
the FrontPage include component.

depending on your sites folder structure you may have to use absolute links
in the menu.

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
--
 
Back
Top