 <p>You can use this function to get query string value:</p> <pre><code>function getParameterByName( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return decodeURIComponent(results[1].replace(/\+/g, " ")); } </code></pre> <p><strong>Example:</strong></p> <pre><code>var param = getParameterByName('yourVar'); </code></pre>