SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: Text Source?

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On PGS Online, I have a menu in a table at the top. This menu is the same on every page, but when we add to the site, I don't want to have to go through every file and type in the edit. Is there any HTML code that will take the text from a .txt file and display it?

    ------------------
    Perth Grammar School Online - www.perth-grammar.pkc.sch.uk

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You could use server side includes (SSI) to do that.

    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.



  3. #3
    SitePoint Enthusiast sawz's Avatar
    Join Date
    Aug 1999
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or if your server dosen't support ssi, try java script.

    document.write("place your line of code here")

    call it up using:

    <script>
    <scriptlanguage="JavaScript1.2" src="wherever you have it"></script>

  4. #4
    SitePoint Enthusiast sawz's Avatar
    Join Date
    Aug 1999
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    which reminds me, whats the best way as far as load on the sever goes:

    delivering with java script
    or using ssi

  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    As far as load on the server... Javascript would be better since there is no extra processing on the servers part. AS far as consistency in your site, SSI is the best because it doesn't rely on client side technology.

    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.



  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use Javascript, but I am considering SSI, esepcially since it will allow me to configure the menu link colours, etc. Differently without having to use CSS, which isn't all that widely supported yet.

    Especially by Netscape.

  7. #7
    jbm
    SitePoint Community Guest
    on JavaScript:

    can I do the same thing as with text but include, lets say, a table in the document.write("..")? Is there any other way besides JS and SSI to do that? (Some servers dont support SSI)

    jbm

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes. I build frames dynamically on one page using document.write(). Just change your double quote (") to single quotes (') in your html tags.

    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.



  9. #9
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Panic not - I've used SSI. The only thing that worries me is that people who have older browsers, will they be able to handle SSI?


    [This message has been edited by perth-grammar (edited January 31, 2000).]

  10. #10
    Chicken
    SitePoint Community Guest
    SSI is "Server Side Includes", meaning the server does the work, not the browser. Browser age has nothing to do with it. The test you include, however, may or may not work with older browsers.

    Meaning if you include a text file with HTML that is not supported in early browsers, it won't work (same as usual).

  11. #11
    ********* Scotland Saltire's Avatar
    Join Date
    Jan 2000
    Location
    Scotland
    Posts
    660
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to do the same thing, but my server doesn't support SSI and I'm using a free host - no cgi-bin etc. Is there no way that you can use HTML or something else to insert the file contents? I also don't want to use Javascript, as I don't want visitors with older browsers not to see the menus.

  12. #12
    ********* Addict
    Join Date
    Feb 2000
    Location
    NE FL, USA
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.VirtualAvenue.net is a free hosting service that give you your own CGI-BIN and supports SSI's

    ------------------
    Street Bikers Unitedprotecting the rights of motorcyclists worldwide.
    C&M Web Design


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
  •