View Single Post
  #5 (permalink)  
Old 03-12-2006, 04:35 AM
scasey scasey is offline
New Pligger
 
Join Date: Mar 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Target is null or not an object

I get the same error in IE but it works in FireFox. The error occurs in:

xmlshttp.js - line 114 char 3
Error: "target2" is null or not an object

This seems to be the function producing the error message:

function changemnmvalues (id, error)
{
split = new RegExp ("~--~");
b = mnmString[id].split (split);
target1 = document.getElementById ('mnms-' + id);
target2 = document.getElementById ('mnmlink-' + id);
if (error) {
target2.innerHTML = "<span>vote cast</span>";
return false;
}
if (b.length <= 3) {
target1.innerHTML = b[0];
target1.style.backgroundColor = mnmPrevColor[id];
target2.innerHTML = "<span>vote cast</span>";
}
return false;
}

I tried declaring target2 as a string & an array but they didn't support the function call. Where are target1 & target2 declared? What type should they be?

Thanks,
S
Reply With Quote