Bug#346043: Javascript bug in pkgreport.cgi
Package: www.debian.org
Severity: minor
Hi,
pkgreport.cgi generates problematic JavaScript code: in function
pagemain(), toggle(2) is called but there is no element with id="a_2".
This causes Opera and Firefox to generate a Javascript error
(getElementById() returns null, which has no property .style.display). I
didn't test other browsers.
As a temporary fix, I used User Javascript (Opera's version of
GreaseMonkey) to use this version of toggle() instead:
function toggle(i) {
var a = document.getElementById("a_" + i);
if (a) {
if (a.style.display == "none") {
a.style.display = "";
} else {
a.style.display = "none";
}
}
}
Admittedly, this doesn't fix the real problem, but I wasn't sure that
pkgreport.cgi wouldn't sometimes generate a page where the toggle(2)
call is necessary. From looking at the HTML, it seems that it's caused
by an off-by-1 error (is it generated by a loop in pkgreport.cgi?).
This error is mostly harmless, but it's probably a good idea to fix it.
:-)
--T
Reply to: