SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Aug 1999
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Being a firm believer in SSI for ease of maintenance and flexibility, I came up with this problem.

    I want to use Javascript to build a SSI call on the fly from the query string in the URL.

    I know how to retrieve the query string, and write code into the HTML on the fly using Javascript, but all my efforts to write a SSI call with Javascript have been fruitless.

    Anyone have any ideas?

    Richard

    ------------------
    rperry@tioloco.com

  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 can't do it with Javascript because its executed on the client AFTER the page is delivered. You need to build your SSI call before the page is delivered. Depending on your server setup you should have a couple of options available to you. You can use ASP, PHP or MivaScript if those engines are available to you. If not you can write a wrapper cgi script for your SSI. This script will process your URL and then call the appropriate SSI functions and insert them in your document.

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

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


  3. #3
    SitePoint Member
    Join Date
    Aug 1999
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wayne,

    Thanks, I really hadn't thought thru the logic of it.

    What I did do was write a CGI script to build the page on the fly (and it works), but it was a painful learning process, and I thought the other alternative would have been a lot cleaner.

    Thanks,
    Richard

    ------------------
    rperry@tioloco.com

  4. #4
    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)
    Your welcome. I try to help as much as I can in these forums because I have learned a lot from them. Enough to enable me to develop a new business model for myself and change my development focus towards something that will be more enjoyable to me in the years to come.

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

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


  5. #5
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    Vilnius, Lithuania
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do some trick using invisible frames. You can load what you need it the invisible frame and the access it from your content frame with javascript.

    Hope this helps

    ------------------
    Alan Mendelevich aka ailon
    New! ArticleCentral.com - The content directory for web professionals. Monitoring hundreds of web development related sites, daily.
    Visit MEGOPhotos - Quality photos for FREE


  6. #6
    SitePoint Member
    Join Date
    Aug 1999
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to all....

    Actually the CGI script that I wound up writing does the job quite well, including parsing the header file, loading images, parsing the description text file, parsing the footer file and building the page, all based on the query string in the URL.

    Being CGI challenged, I was reluctant to tackle it, but it wasn't as bad as expected, and turned out well.

    If anyone else has a need for this type of script, let me know.

    Richard

    ------------------
    rperry@tioloco.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
  •