• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

CGI and JavaScripts?

Lucky13

New Member
Well, here's my problem:
I use .js files for menus on my website http://kodhome.com, and I want to use a .cgi script that will randomly pick text and display it. I tried using the normal tag <!--#exec cgi="scripts/rand_text.cgi"--> within 'document.write', but it didn't work. Is there another way of doing this or is this a lost cause?
Thanks a lot.
 
Originally posted by Lucky13
Well, here's my problem:
I use .js files for menus on my website http://kodhome.com, and I want to use a .cgi script that will randomly pick text and display it. I tried using the normal tag <!--#exec cgi="scripts/rand_text.cgi"--> within 'document.write', but it didn't work. Is there another way of doing this or is this a lost cause?
Thanks a lot.

I'm not quite sure what you're doing, but I think it'd be best to have a CGI script randomly generate the name of the .js file to include.

So
Code:
<!--#exec cgi="scripts/rand_text.cgi"-->
would output the JS code in your HTML that puts somethingrandom.js in.

-mk
 
ok...I tried using it without the "document.write" and it didn't work. What I'm trying to do, is make a random banner display. I think making a separate 14k .js file for each banner would be irrational. Does anyone know how to do this with Java? THanks a lot.

~Lucky
 
include virtual

Try using:

Code:
<!--#include virtual="file.cgi"-->

I tried to use exec cgi before also, and it didn't work, so I used that...and it did. (Strange!)
 
Back
Top