Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switch ssi with javascript

Status
Not open for further replies.

Pichdude

Programmer
Aug 24, 2005
66
SE
I want to be able to control which file is to be included in a page by help of javascript. Can I have links on index.htm, e.g. index.htm?id=page1 and index.htm?id=page2. Then when the visitor clicks a link the id-parameter is taken from the request and somehow placed in <!--#include file="xxx.htm" --> where "xxx" should dynamically be page1.htm or page2.htm.
 
You are trying to change a server-side include from the client-side. This cannot be done, for obvious reasons (i.e. the server-side code is parsed before being sent to the client).

You will need to use a server-side language to parse the request. Something like PHP would work if you are using Apache.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top