The JavaScript code function $(id) { return document.getElementById(id); } window.onload = function() { var out = ""; var queryString = window.location.search.substring(1); if (queryString.length == 0) { out += "Error: no fields found"; } else { var fields = queryString.split('&'); for (var i=0; iKey: ' + key + ', Value: ' + value + ''; } $('result').innerHTML = out; } };