[thelist] javascript and SSI
Michael Fritz
fritz321 at hotmail.com
Fri Jul 14 14:17:17 CDT 2000
Why not just replace "<!--#include virtual='/include/myway.txt'-->" with the
text that you want to include?
Mike
>I'm trying to include a small piece of text using SSI but I want it's
>inclusion to be dependant on a browser detect. In simpler terms, I want
>to detect whether or not the viewer is using a 3.x browser or a 4.x browser
>and then include the file only if the browser version is 4.0 or
>above. Here is what I've come up with but it doesn't work:
>
>IN THE HEAD
><!-- to hide script contents from old browsers
>var bName = (navigator.appName);
>var bVer = parseFloat(navigator.appVersion);
> if (bVer >= "4" )
> var go = "<!--#include virtual='/include/myway.txt'-->";
>
> if ((bName == "Microsoft Internet Explorer") &&
>(bVer >= "4" ))
> var go = "<!--#include virtual='/include/myway.txt'-->";
>
> if (bVer < "4")
> var go = "";
>
>// end hiding contents from old browsers -->
>
>
>IN THE BODY
><SCRIPT LANGUAGE="JavaScript">
><!--
> document.write(go);
>-->
></SCRIPT>
>
>If I replace the "<!--#include virtual='/include/myway.txt'-->" with
>"Jamie" it will write Jamie to the screen but it will not write the
>include. I suspect that I'm going about this entirely incorrectly. Can
>someone help?
>
>jamie
>
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
More information about the thelist
mailing list