To get the query string of a page using javascript, use the below code snippet:
window.top.location.search.substring(1);