Getting javascript errors

Hi

I keep getting a TypeError: Result of expression 'options' [null] is not an object.

on this javascript

function ajxCastVote(){
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 404)){
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(xhr.responseText);
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(xhr.responseText,"text/xml");
}
catch(e) {alert(e.message)}
}

var options =xmlDoc.getElementsByTagName('options').item(0);
if(options == null){
options = xmlDoc.getElementsByTagName('errormsg').item(0);
var error = options.childNodes[0].nodeValue;
document.getElementById('loadingImg').style.display = 'none';
alert(error);
return;
}
updatePieChart(options,'Henter resultaterne.....'); updateWrapper();
}
}

optionid = getSelectedValue();
if(optionid == null){
alert('Du mangler at tage en valgmulighed.');
return;
}
document.getElementById('loadingImg').style.display = '';
xhr.open("GET","index.php?option=com_communitypolls&controller=polls&task=ajxvote&id="+
2+"&option_id=" + optionid,true);
xhr.send(null);
requestSent = true;
}


To be specific, this is the line that my "debugger" complains about:

options = xmlDoc.getElementsByTagName('errormsg').item(0);



The result is, I cannot vote on any polls. Any advise?

Access to viewing replies is restricted.
Showing 1 of 1 replies
You do not have permissions for replying to this topic.
Loading...
Confirm delete? This action is irreversible and the data will be deleted permanently. Do you want to continue? Confirm Add New Delete Unpublish Cancel Import Uninstall The selected item successfully deleted.
Shondalai