Mostly harmless (corto) wrote,
Mostly harmless
corto

javascript / html question

ok... I'm looking for help on something to do with a javascript...

Thank you markalope
(a happy corto be here)

Bottom Line: Any idea how I can cause a variable in a javascript to be populated by the contents of a referenced text file?


On the index page of my site (www.corto.ca/corto) there is a little scrolling window with the heading "Site History". Below that is a honking big block of javascript garnered from elsewhere on the web. There is a "var" tag at the top of that script which populates the variable 'content' with a bunch of text... so if that var tag looked like;

var content='ALL KINDS OF TEXT GOES HERE'

the scrolling window would display the clause "ALL KINDS OF TEXT GOES HERE" and scroll it past.

So far so good?

Ok, now the issue is that every time I want to add to the site history I have to open up index.html and add to the string at the end of the var line.
My desire is to have a text file (i.e. history.txt) in the root directory of that web URL that the variable is populated from... sorta like;

var content=history.txt

... but, of course, this does not work...

Any idea how I can cause a variable in a javascript to be populated by the contents of a referenced text file?
Subscribe

  • shiver

    You know that shiver you get through your shoulder blades and down your back when you feel cold. Maybe you’ve just left the restaurant and you’re…

  • selfie

    as I read and read and read about "Selfies"... I quietly say to myself... "um... yeah, tell me again how selfies are a new thing." lol. :)

  • Monday, February 17, 2014

    Hiya. :) Today was one of those “oh look… LJ is still there” days. Oh how I miss the old days when LJ was pretty much a playground filled with my…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 8 comments