How to check if query string present on URL using jQuery?

document.location contains information about the URL, and document.location.search contains the query string.
if(document.location.search.length)
{
    // query string exists
}
else
{
    // no query string exists
}
You even don't require jQuery. You can do that using simple jQuery.

Comments

Popular Posts