Load the script file in the head section
<script type="text/javascript" src="MyScript.js"></script>
That makes all functions available to the page
Then in the page (or body tag or head section), as needed, call the script Function you need as in:
<body onload="detect();"> or
<a href="GoSomewhere.htm" onclick="detect();">Call a script</a>
| I guess... what I'm getting at is this. Currently my script each begin with
|
| function detect()
| {
| script goes here!
| }
|
| Each script has it's own name, therefore, you call the script by the "name"
| (ie MyScript.js).
|
| If I simply repeat (the above block) several times to include each script
| section on one *.js, how would you call the specific "code section" (or
| function) within the script. You would need to call the script (by name)
| then somehow call the individual function that is required, ie
| MyScript.func1().
|
| Hope this makes sense.
| Is this ever done?
|
| | > Not a bad idea. Just call it as you normally would.
| >
| > --
| > Jim Cheshire
| > Jimco Add-ins
| >
http://www.jimcoaddins.com
| > ================================
| > Author of Special Edition
| > Using Microsoft Office FrontPage 2003
| > 5 Stars on Amazon and B&N
| > ================================
| >
| >
| >
| >
| > | > > What if you want multiple scripts on one page (MyScripts.js). How do
| you
| > > call the individual scripts with in the script. Or is this a bad idea.
| > > Thanks
| > >
| > > | > > > Use the steps you've been given below, but instead of manually adding
| > that
| > > > code to each page, use Scripter which you can download free from my
| Web
| > > > site. It will make it easy to apply that script to all pages (or
| > selected
| > > > pages) in one easy step.
| > > >
| > > > --
| > > > Jim Cheshire
| > > > Jimco Add-ins
| > > >
http://www.jimcoaddins.com
| > > > ===================================
| > > > Buy my book!
| > > > Special Edition Using Microsoft FrontPage 2003
| > > > Don't take my word for it. Read the reviews!
| > > > ===================================
| > > > Our newest add-in:
| > > > FrontPage Cart Companion
| > > >
http://www.frontpagecartcompanion.com
| > > >
| > > >
| > > > | > > > > I have a script that is located in every html on my site. Is there
| > > anyway
| > > > > to put this script in a single location and call it from each site.
| > > That
| > > > > way, one change to the script will instantly change every page.
| > > > >
| > > > > Thanks
| > > > >
| > > > >
| > > >
| > > >
| > >
| > >
| >
| >
|
|