Well, the toLowerCase() is ugly to the eye, but it's actually pretty effective.
All the other solutions will involve more code.
You might want to create a custom function just for this purpose:
Function JSBoolean( test As Boolean ) Returns String
If test Then Return "true"
Return "false"
End Function
You could, of course, do it with IIF:
if ( <%= IIF( loResultSet is nothing, "true", "false" )%> )
But I think I like
if ( <%= JSBoolean(loResultSet is nothing) %> )
better.
Finally, you *could* do the test in your
VB code!
<% If loResultSet is Nothing Then %>
...
js code for true condition ...
<% Else %>
...
js code for false condition ...
<% End If %>
And that's actually the most efficient. No point in sending
JS code to the browser when it won't be used.