SSI in JavaScript Help
i have a random text script in perl that i want to put onto my site , and i have tried it on the shtml pages using simple SSI !--#exec cmd="cgi-bin/randhtml.cgi" and everything works fine , but i want to put the script in my nav bar.
now my nav bar is js , the whole bar is just loaded from a js file so i can edit it and it will change on all my pages. i tried putting the SSI call in the script but it didn't work. (i did change it too !--#exec cmd=\"cgi-bin/randhtml.cgi\"-- first).
i know the whole concept of SSI is server side , JS is normaly client side , but is there anyway i can call my perl script from my js file???
ShaneS posted this at 23:30 — 2nd June 2004.
They have: 93 posts
Joined: Jun 2003
You would have to edit the httpd.conf or your .htaccess (if the host allows it) and include .js as a SSI parsed file type.
I would paste the code, but I don't know it off the top of my head.
I better solution IMO would be to rename the js to a .shtml and place the default <script> stuff JS needs around it, then include that file on each page via SSI. Then you can still edit the file and it will change on each page, however it will also still be valid SSH parsable.
Only issue I do forsee is SSI may be recongnizes in the middle of JS.
[Design Alpha] -Web Services : Design,Hosting,Advertising,Software
Ask about custom pricing on hosting!!
Site Assets: [UltraGaming.com] [Blades of Warcraft]
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.