diff options
Diffstat (limited to 'ws2a/bugview.js')
| -rw-r--r-- | ws2a/bugview.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ws2a/bugview.js b/ws2a/bugview.js index 4c8b007..2f9740f 100644 --- a/ws2a/bugview.js +++ b/ws2a/bugview.js @@ -1,11 +1,29 @@ +function getQueryStrings() { + var assoc = {}; + var decode = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); }; + var queryString = location.search.substring(1); + var keyValues = queryString.split('&'); + + for(var i in keyValues) { + var key = keyValues[i].split('='); + if (key.length > 1) { + assoc[decode(key[0])] = decode(key[1]); + } + } + + return assoc; +} + function loadLastBugs() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { - document.getElementById("bugstable").innerHTML = xhttp.responseText; + document.getElementById("longdesc").innerHTML = xhttp.responseText; } }; - xhttp.open("GET", "/cgi-bin/bugsdata.cgi", true); + var query = getQueryStrings(); + var bugnum = qs["id"]; + xhttp.open("GET", "/cgi-bin/showbug.cgi?id="+bugnum, true); xhttp.send(); } window.onload = loadLastBugs |
