SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Technically, a bit dim macdan's Avatar
    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.

  2. #2
    You talkin to me? Anarchos's Avatar
    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.

  3. #3
    Technically, a bit dim macdan's Avatar
    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 thanks
    Last edited by macdan; Jul 3, 2001 at 04:10.
    gorillaweb is a small London based digital design agency.

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    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.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  5. #5
    Technically, a bit dim macdan's Avatar
    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.

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    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
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •