View Full Version : CGI and JavaScripts?
Lucky13
April 2nd, 2001, 18:01
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.
Canuckkev
April 2nd, 2001, 18:58
Why in the document.write? Jut put the tag right in your code, no script block is needed.
atlas
April 3rd, 2001, 17:35
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
<!--#exec cgi="scripts/rand_text.cgi"-->
would output the JS code in your HTML that puts somethingrandom.js in.
-mk
Lucky13
April 4th, 2001, 15:59
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
Niaad
April 4th, 2001, 18:06
Try using:
<!--#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!)
Lucky13
April 4th, 2001, 18:20
muchas gracias, nick.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.