Adam wrote:
Quote:
Hi All,
Is it possible to use includes dynamically in html.
....
|
Quote:
script language="javascript"
function checkFileToInclude(){
if (location.search == "?file1"){
return "<!--#include file='file1.html'-->"
}else{
return "<!--#include file='file2.html'-->"
}
}
/script |
Lol not unless this script runs on the server... I assume you want to
perform the actions in the #include statements, and those should be
performed on the server side, since the JavaScript is executed on the
client side the server will never know what process.
The funny thing is that this may actually work, but then the other way
round from what you seem to expect: the server will, *before* sending
the result to the client, replace the SSI instructions with the content
of *both* html files and later on the JavaScript picks one of those to
use...
Cheers,
Guido