SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: dhtml script as an include
-
Jul 2, 2001, 09:10 #1
- Join Date
- Feb 2001
- Location
- London
- Posts
- 344
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
dhtml script as an include
HI there
I picked up a great little dhtml scroller script from dynamic drive which I named "scroller.js"
see:
http://www.dynamicdrive.com/dynamicindex2/crosstick.htm
I would like to use this, but put it in my page as an include so I don't have to amend every page when the content changes, is this correct:
<script language="Javascript1.2" src="scroller.js"></script>
When I use this code I get a javascript syntax error, I've checked the path and names etc. The error refers to the evry beginning of the file - (I assume the scroller.js file).
Thanks for any help.gorillaweb is a small London based digital design agency.
-
Jul 2, 2001, 19:47 #2
- Join Date
- Oct 2000
- Location
- Austin, TX
- Posts
- 1,438
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There's some HTML in there that you'll need to either convert to js or include with SSI or something else for all of your files.
-
Jul 3, 2001, 01:24 #3
- Join Date
- Feb 2001
- Location
- London
- Posts
- 344
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Anarchos.
How would I go about converting the html to javascript? Is it as simple as surrounding the html with
document.write('html code')
?
Many thanksLast edited by macdan; Jul 3, 2001 at 04:10.
gorillaweb is a small London based digital design agency.
-
Jul 3, 2001, 07:29 #4
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
If your host supports Server Side Includes, the syntax is:
<!--include file="myfile.html"-->
You can then include your html AND the JS in there and only have to maintain one file across your website (or 2 if you put the JS in a separate file).
Btw, your external JS call is fine.
-
Jul 3, 2001, 08:38 #5
- Join Date
- Feb 2001
- Location
- London
- Posts
- 344
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks - I'm sure they do support SSIs.
gorillaweb is a small London based digital design agency.
-
Jul 3, 2001, 08:40 #6
- Join Date
- Jun 2001
- Location
- Toronto, Canada
- Posts
- 9,123
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Yeah, I haven't seen a host that doesn't (besides free hosts) in about 2 years, though I'm sure they are out there
Bookmarks