HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 19th, 2000, 01:33 PM
artfold artfold is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 5 artfold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I am trying to use JS to include some files in a cgi script. I have tried both:

<script language="javascript">
<!--
document.write("http://www.domain.com/nav_side_main_home.inc");
// -->
</script>


and


<script language="javascript">
<!--
document.write("<!--#include virtual="../nav_side_main_home.inc" -->");
// -->
</script>

In both cases all that prints is the URL and not the file.

Can anyone offer assistance?

Art

Reply With Quote
  #2  
Old March 20th, 2000, 01:39 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 44
Of course, in the first instance Javascript is just dealing with a text string. the only way to get java to write the CONTENTS of the file there is to make 1 or more variables out of the whole contents of the include file, and then have javascript write out those variables--it can be done (in IE, at least), but what a messy solution.

In the second section I believe the server will not parse the include as long as it is inside the <script> tags or the parentheses. But even so, again you cannot just do document.write and spew regular HTML (with carriage returns, etc...) in there and expect Javascript to deal with it.

I misunderstand why you even need javascript at all, though. Shouldn't a standard include to the trick, if you just want HTML from another file written inside this file? Please explain your needs a little more clearly.

Reply With Quote
  #3  
Old March 20th, 2000, 05:25 AM
artfold artfold is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 5 artfold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you for your help.

What I am trying to do is the following.

I have a cgi search script. Results are yielded by mereging data with an html template. I can design the template however I like because it is just html. When results are shown on the screen, the url is search.cgi. Because it is a cgi my ssi's do not work. I need a way to structure the ssi's within a cgi.

As a side note I have also placed a .htacess file in my dir and tried the following:

AddHandler cgi-script .html
AddType text/x-server-parsed-html .html

The cgi works but still no ssi.

Thank you for any help you can lend.

Art

[This message has been edited by artfold (edited March 20, 2000).]

Reply With Quote
  #4  
Old March 22nd, 2000, 12:54 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 44
Well, my expertise is with PHP and ASP, so I don't know how much help I can be, but in my PHP and ASP, for example, there is a built-in include method: include(), that let's me include any HTML I want to be output along with the server-generated code. If you are using Perl, I am sure there is a way. It might be a little more complicated, like using a command to open the file and read the contents into a variable, and then printf that variable into the perl output.

It really should be done with your server-side code, is my point.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > SSI and JS?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway