I think this is what you are looking for..
1. create a new file called test_js.asp and insert all this code:
<% Response.ContentType = "text/javascript" %>
function getSentence()
{
var iUsers = <%= application("HowManyMembersInForum") %>;
var iGuests = <%= application("HowManyGuestsInForum") %>;
var sOutput = '';
// validating
if ( IsNumeric(iUsers) == false ) iUsers = 0;
if ( IsNumeric(iGuests) == false ) iGuests = 0;
// Builing the output text
if ( iUsers == 0 ) sOutput = 'There is no current members ';
if ( iUsers == 1 ) sOutput = 'There is 1 current member ';
if ( iUsers > 1 ) sOutput = 'There are currently ' + iUsers + ' members ';
if ( iGuests == 0 ) sOutput = sOutput + 'and no current guests viewing the forum.';
if ( iGuests == 1 ) sOutput = sOutput + 'and only 1 guest viewing the forum.';
if ( iGuests > 1 ) sOutput = sOutput + 'and ' + iGuests + ' guests viewing the forum.';
// Outputting
document.write(sOutput);
}
// just to check if the String is a Numeric Number
function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
IsNumber = false;
}
return IsNumber;
}
response.Flush()
2. in your HTML code, put this inside the HEAD tag
<script src="test_js.asp" ></script>
3. and when you want to put the line, add this:
<script type="text/javascript"> getSentence(); </script>
I think that is what you are after
rgds andy