I have a query string in javascript which looks like this : Default.aspx?7KCN0008-001 and when i try to insert 7KCN0008-001 into the textbox i get [object Object] how can i put the value inside the textbox here is what i have:
function test() {
var urlParams;
(window.onpopstate = function () {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl,"")); },
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
})();
$('#txtStockCode').val(urlParams[decode(match[1])]);
}