diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-09 16:12:59 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-09 16:12:59 -0400 |
| commit | bfb4f9159a849accfbe402aa971cdd0f0be76c10 (patch) | |
| tree | c4d0b9366f8094d5ca2b9777da68f890c435470d /ws2a/bugview.js | |
| parent | 4ba6f3e5ceed1bd7ff454fce96348e3b5c052b70 (diff) | |
| download | webpage-bfb4f9159a849accfbe402aa971cdd0f0be76c10.tar.gz webpage-bfb4f9159a849accfbe402aa971cdd0f0be76c10.tar.bz2 webpage-bfb4f9159a849accfbe402aa971cdd0f0be76c10.zip | |
More work on showing a bug
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 |
