QueryString Parser

Why JavaScript doesn't have a native way to extract data from form posts, query strings and cookies is a mystery to me. Though with a small function I can fix the querystring problem.

Input:
Query string parameter
Output:
Query string value
function Q$(fldNm) { var oRe = new RegExp("[\\?&]"+fldNm+"=([^&#]*)","i"); var fldVal = oRe.exec(parent.location.search); return (fldVal) ? unescape(fldVal[1]) : ""; }