/    Sign up×
Community /Pin to ProfileBookmark

Include text file

I’m looking to include a small text file (something like gigs.txt) in my site to show the next gig for a band, rather than editing individual pages. Can this be done purely in html (possibly using the include statement)? I’ve know this works in php, but its a hassle for such a small thing. If not, would there be a way of coding this in JavaScript?

Your help is appreciated

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@ray326Mar 11.2006 — You may be able to use server-side includes rather than PHP or you could investigate putting it in an iframe.
Copy linkTweet thisAlerts:
@pcthugMar 11.2006 — It is possible in JavaScript, but that poses large accessibility issues. Either use an iframe, or better yet a server-side alternative(SSI):<i>
</i>&lt;!--#include virtual="/gigs.txt" --&gt;
Copy linkTweet thisAlerts:
@HemmerauthorMar 12.2006 — [CODE]<div id="gigBar">Next Gig: <!--#include virtual="/gigs.txt" --></div>[/CODE]

I tested the above (both remotely and locally) and it doesn't seem to work. any other ideas?

Does the #include file have to be an .html extension for instance?
Copy linkTweet thisAlerts:
@pcthugMar 12.2006 — #include should be used in conjunction with a [B].shtml[/B] extension on a server with SSI enabled
Copy linkTweet thisAlerts:
@HemmerauthorMar 12.2006 — Unfortunatly the server isnt SSI enabled. I tried the iframe but it looks pretty ugly - especially in IE. Any clues as to the javascript method?
Copy linkTweet thisAlerts:
@HemmerauthorMar 12.2006 — No worries. I found another (accessible) way.

View it at [URL=http://www.force10theband.co.uk]the Force 10 website.[/URL]
Copy linkTweet thisAlerts:
@the_treeMar 12.2006 — So urm, what did you use? Care to enlighten us?

[i]edit[/i] Kudos on the site, it's neatly coded and the design isn't far off.
Copy linkTweet thisAlerts:
@HemmerauthorMar 12.2006 — Cheers. ?

I created a RSS feed (which I was going to do eventually anyway) and found [URL=http://www.dynamicdrive.com/dynamicindex17/rsstickerajax/index.htm]a neat script[/URL] which cycled through the items, in this case gigs and dates etc, and is W3C conpliant.
×

Success!

Help @Hemmer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...