SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru kish's Avatar
    Join Date
    Jun 2003
    Location
    UK
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS alternative to SSI??

    I'm looking for a java script alternative to using Server Side Includes...

    Basically, i have a fair bit of HTML inside a <div> and would like to put the div into an external file so that all my pages can reference that external file to save the same code having to be loaded over and over again for each page.

    Hope that makes sense. Any help appreciated...!
    Fast Fwd Multimedia
    Web, IT & Cloud Computing Consultancy
    Currently looking for web freelancers. Get in touch!

  2. #2
    SitePoint Enthusiast Radnor's Avatar
    Join Date
    Feb 2002
    Location
    Orlando, FL
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can include a .js javascript file that outputs HTML. An example can be found here:

    http://www.moock.org/webdesign/javas...-side-include/

  3. #3
    SitePoint Guru kish's Avatar
    Join Date
    Jun 2003
    Location
    UK
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers radnor - worked a treat!
    Fast Fwd Multimedia
    Web, IT & Cloud Computing Consultancy
    Currently looking for web freelancers. Get in touch!

  4. #4
    SitePoint Guru kish's Avatar
    Join Date
    Jun 2003
    Location
    UK
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just a quick thought - does putting my html in such a js file affect search engine indexing? Will SE's read the JS include and find the html?
    Fast Fwd Multimedia
    Web, IT & Cloud Computing Consultancy
    Currently looking for web freelancers. Get in touch!

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by kish
    just a quick thought - does putting my html in such a js file affect search engine indexing? Will SE's read the JS include and find the html?
    Search engines ignore anything in a <script> block.


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
  •