4 * Gets full query as string with all special chars decoded.
6 function getQuery(url) {
7 url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query)
8 var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt
9 return (queryString)? decodeURIComponent(queryString[0]) : '';