C
Calan
How can I write an ASP variable (using document.write) with JS and a CSS
class? Is there an easy way to "share" variables between client-side JS and
server-side ASP?
For an example, suppose I'm using JS to check for the browser version. If it
is > 4, I want to write a line of text (a shadow, set with CSS)containing a
server variable. Here is my pseudo-code so far, using single quotes, but it
doesn't work. The line in question is the "var" line:
<div id="PageTitle">
<h2 class="TitleForeground"><%=Session("CurrentPageTitle")%></h2>
<script language="JavaScript" type="text/JavaScript">
<!--
var titleshadow= "<h2
class='TitleForeground'><%=Session('CurrentPageTitle')%></h2>"
if
((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)>4)) {
document.write (titleshadow);
}
if
((navigator.appName=="Microsoft")&&(parseInt(navigator.appVersion)>4)) {
document.write (titleshadow);
}
//-->
</script>
</div>
In a similar way (on a different page), I need to display an image link for
higher browsers, and a straight <a> link for 4 and lower.
TIA for any help!
Calan
class? Is there an easy way to "share" variables between client-side JS and
server-side ASP?
For an example, suppose I'm using JS to check for the browser version. If it
is > 4, I want to write a line of text (a shadow, set with CSS)containing a
server variable. Here is my pseudo-code so far, using single quotes, but it
doesn't work. The line in question is the "var" line:
<div id="PageTitle">
<h2 class="TitleForeground"><%=Session("CurrentPageTitle")%></h2>
<script language="JavaScript" type="text/JavaScript">
<!--
var titleshadow= "<h2
class='TitleForeground'><%=Session('CurrentPageTitle')%></h2>"
if
((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)>4)) {
document.write (titleshadow);
}
if
((navigator.appName=="Microsoft")&&(parseInt(navigator.appVersion)>4)) {
document.write (titleshadow);
}
//-->
</script>
</div>
In a similar way (on a different page), I need to display an image link for
higher browsers, and a straight <a> link for 4 and lower.
TIA for any help!
Calan