Hi,
I'm writing Javascript code to parse out a query string. I want to
handle the case where a parameter value may not be sent.
So consider a parameter called "State". If the user doesn't pass that
in if I do this:
var state = <%=Request.Quer yString["State"]%>
This returns an undefined object that I can't seem to do any checks
against it. So I was told to do this instead (put ticks around the
Request.QuerySt ring):
var state = '<%=Request.Que ryString["State"]%>'
This works if State is empty. But it fails if it contains a value.
So how do I handle the possibility that State might not be sent?
I'm writing Javascript code to parse out a query string. I want to
handle the case where a parameter value may not be sent.
So consider a parameter called "State". If the user doesn't pass that
in if I do this:
var state = <%=Request.Quer yString["State"]%>
This returns an undefined object that I can't seem to do any checks
against it. So I was told to do this instead (put ticks around the
Request.QuerySt ring):
var state = '<%=Request.Que ryString["State"]%>'
This works if State is empty. But it fails if it contains a value.
So how do I handle the possibility that State might not be sent?
Comment