Retrieve a query string variable from the current page

Marketing Glossary

Market Ruler, LLC

Retrieve a query string variable from the current page

Retrieves the value of a Query String from the current page's query string.

string CR_QS(variable-name, default-value);

Example: For example, if the current page URL is: http://www.example.com/?productId=124123&crsource=Google&offset=20&index=1&wrap=true Then the following code: <script type="text/javascript">
document.write(CR_QS('productId'));
document.write(CR_QS('departmentId','no department'));
</script>
Will output the text "124123" and "no department" to the current page.

Jump to: navigation, search