Get the query string using javascript

To get the query string of a page using javascript, use the below code snippet:

window.top.location.search.substring(1);
Comment