Garath531
07-24-2007, 06:49 PM
I'm using this code.
<script type='text/javascript'>
var forum = 2
function request() {
if (window.XMLHttpRequest ) { return new XMLHttpRequest(); }
else if (window.ActiveXObject) {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
return false;
}
}
}
}
if(location.href.match(/showforum=/i) && !location.href.match("showforum=" + forum)) {
var tr = document.getElementsByTagName('tr')
for(k=0;k<tr.length;k++) {
if(tr[k].innerHTML.match(/topic title/gi) && tr[k].innerHTML.match(/replies/gi)) {
var table = tr[k].parentNode
var tr2 = table.getElementsByTagName('tr')
for(z=0;z<tr2.length;z++) {
if(tr2[z].innerHTML.match(/topic title/gi)) {
var req = request();
var theLoc = location.href.split("?")[0]
req.open("GET", theLoc + "?showforum=" + forum)
req.onreadystatechange = function() {
if(req.readyState == 4) {
var text = req.responseText
document.getElementsByTagName('body')[0].innerHTML += "<div id='theAnnounce' style='display: none;'>" + text + "</div>"
var newRow = table.insertRow(z+1)
var newCell = newRow.insertCell(-1)
with(newCell) {
className = "darkrow1"
innerHTML = " "
}
}
}
req.send(null)
}
}
}
}
}
</script>
and it keeps giving that error (see topic title) on line 397.
Line 397 is this line.
var newCell = newRow.insertCell(-1)
I can't figure out what's wrong with it. Can anyone help me?
<script type='text/javascript'>
var forum = 2
function request() {
if (window.XMLHttpRequest ) { return new XMLHttpRequest(); }
else if (window.ActiveXObject) {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
return false;
}
}
}
}
if(location.href.match(/showforum=/i) && !location.href.match("showforum=" + forum)) {
var tr = document.getElementsByTagName('tr')
for(k=0;k<tr.length;k++) {
if(tr[k].innerHTML.match(/topic title/gi) && tr[k].innerHTML.match(/replies/gi)) {
var table = tr[k].parentNode
var tr2 = table.getElementsByTagName('tr')
for(z=0;z<tr2.length;z++) {
if(tr2[z].innerHTML.match(/topic title/gi)) {
var req = request();
var theLoc = location.href.split("?")[0]
req.open("GET", theLoc + "?showforum=" + forum)
req.onreadystatechange = function() {
if(req.readyState == 4) {
var text = req.responseText
document.getElementsByTagName('body')[0].innerHTML += "<div id='theAnnounce' style='display: none;'>" + text + "</div>"
var newRow = table.insertRow(z+1)
var newCell = newRow.insertCell(-1)
with(newCell) {
className = "darkrow1"
innerHTML = " "
}
}
}
req.send(null)
}
}
}
}
}
</script>
and it keeps giving that error (see topic title) on line 397.
Line 397 is this line.
var newCell = newRow.insertCell(-1)
I can't figure out what's wrong with it. Can anyone help me?