SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to have a java script execute SSI. For example, to have a page, and then instead of the normal SSI: <!--#include virtual="blabla.shtml"--> to have a Java Script do this.

    I am asking this because I have a template for a CGI script, but can't find a way to include SSI in the template.

    Does anyone know of a solution?
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is not possible because JavaScript is a client-side scripting language and SSI is processed by your Web server. In essence, the SSI's are done their job long before your Web browser even loads the JavaScript code in the page.

    I am asking this because I have a template for a CGI script, but can't find a way to include SSI in the template.
    I'm not sure what you mean by this. If I understood your problem I'm sure we could find a way to solve it.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, I have a CGI script and it displays data in a template that I make. When I put a SSI in the page, it doesn't display it... it simply shows nothing.
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can't use SSI in a template used by a CGI script, since SSI is processed by your Web server and a CGI script runs as a separate program outside your Web server.

    You'll need to either modify the CGI script to do what you need or find another solution.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  5. #5
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm new to CGI, so let me ask you...

    Is it possible to tell the CGI to search for certain keywords in a template, and then replace it with the SSI script?
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  6. #6
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes, that is easily done in Perl.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  7. #7
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where can I find a tutorial on that? Or, could you perhaps show me a sample of code?

    I'm planning on going to buy a book this weekend, suggest any?
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  8. #8
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by WebMasterAJ
    Where can I find a tutorial on that? Or, could you perhaps show me a sample of code?
    There are actually better ways to do what you're thinking of in Perl, PHP, ASP, or CFML (all of these are server-side scripting languages). I'd suggest you read up on one of these languages -- you should find it doesn't take long to learn what you need to know.

    I'm planning on going to buy a book this weekend, suggest any?
    I suggest you read Advanced Web Design: A Primer to decide what language you'd like to learn before picking a book. There are a lot of options for Server-Side Scripting, and for the first-time programmer Perl can be an unneccessarily difficult choice.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  9. #9
    SitePoint Zealot
    Join Date
    Nov 2000
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I may be out of line, but there is ssjs (server side java scripting)

    within the html code you add <server> </server> tags. (But you need a live wire compatible server. (Netscape, Enterprise server, fast track server, and application server)

    Maybe that could help out a bit.

  10. #10
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I ah missed this thread. It has been covered before and yes you can process SSI's with javascript.

    http://www.sitepointforums.com/showt...threadid=14443

    It's basically a work around so that they are processed last or can be processed as part of if - then statement.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  11. #11
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just tried this:

    <Script Language=JavaScript src="120x60.shtml"></Script>

    And it didn't work
    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  12. #12
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by WebMasterAJ
    I just tried this:

    &lt;Script Language=JavaScript src=&quot;120x60.shtml&quot;&gt;&lt;/Script&gt;

    And it didn't work
    The page that you are loading should be the included page and should not contain an SSI within it. In other words, neither page needs to end with a .shtml
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  13. #13
    SitePoint Addict WebMasterAJ's Avatar
    Join Date
    Aug 2000
    Location
    Miami
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The page thats loaing the javascript, and the page that its trying to call on are both .html

    <Script Language=JavaScript src="about.html"></Script>

    And its a no go

    Andrew Tatum
    FinHeaven & Co - Get Drenched With Finformation
    The FinHeaven & Co Forums

  14. #14
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My most sincere and humble apologies. If there was a foot-in-mouth emoticon, I would be using it.

    I don't remember where I had come across that article about using the JavaScript include, but apparently its wrong. I tried it several times myself and was unable to get to work.

    Sorry about that.

    On a side note, though, if you choose to develop in Cold Fusion, includes are processed in-line with all other code.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com


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
  •