I would like to know whether there is a jQuery function which can check whether a variable in the URL is set.
Something similar to the isset() function in PHP
Thanks
I would like to know whether there is a jQuery function which can check whether a variable in the URL is set.
Something similar to the isset() function in PHP
Thanks
jQuery doesn't have native functions to get URL parameters.
But you can write your own plugin to it:
Then you can do anything like it:
jQuery does not provide such methods. But you don’t even need jQuery to do so:
This extends the
location
object with the methodsgetParameter
,getParameterMap
,getParameterNames
, andgetParameterValues
(similar to Java’s ServeletRequest) that can be used as follows:The return values of
getParameter
have the following meaning:undefined
: given parameter not presentnull
: given parameter has no assigned value (e.g.foo
ina=b&foo&c=d
)