Calling External Script
I know I'm going to sound like an idiot, but I've been trying to get this to work for so long that I'm all rummy and don't even know what I've done, so I don't know what NOT to do. . . I hope y'all don't think I'm a complete idiot and that said. . .
I'm trying to set up a template HTML page for all my pages as I want to avoid frames. I want to call external scripts because (1) I don't want all that stuff on all those pages and (2) I don't want EVERYONE to know how badly I've written them. All my scripts work find UNTIL I try to do the function call.
I've looked everywhere I can think of, including the tutorial here (thanks, John Pollack, you've taught me alot!), but the tutorial on calling external scripts uses a link, which I don't want. I just want the result on the page, not a link.
How do I write the function call for that? I have the correct info in the HEAD, I just don't know syntax for the BODY.
(Yes, I am VERY new at this.)
You can call me stupid as often as you like, as long as someone can tell me how to do it.
Thanks!
John Pollock posted this at 14:12 — 12th March 2000.
He has: 628 posts
Joined: Mar 1999
To call that function, it should work by just inserting the function call in the body where you want it to appear:
<SCRIPT language="JavaScript">
<!--
function();
//-->
</SCRIPT>
There is also an easier way to do this, find out if your host allows SSI. You can also test for it yourself to see if one file will include another, write a short bit of html:
-------
<A HREF="url">Click</A>
-------
Save it with any name you like, I'll call it linkfile.html .
Make another HTML page (this may need to be saved with the extension .shtml instead of .html). This one will try to insert the link code we created:
-------
<HTML>
<BODY>
Does the link show up below? Yes= SSI enabled. No=SSI disabled.
<P>
<!--#include virtual="linkfile.html"-->
<P>
So, did it work?
-------
Open this file (on the server) and see if it includes the file. If not, you might try asking your host if you need to make any other adjustments (some support different ways of calling the file or naming the file extensions).
Java Script: A Beginner's Guide
Page Resource
Rosie posted this at 16:43 — 12th March 2000.
They have: 2 posts
Joined: Mar 2000
Thanks for the wonderfully comprehensive response. I'll try it.
Thanks!
(Guess I could have at least speeled your name write!)
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.