Author Topic: Some Code  (Read 12233 times)

Offline Crip

  • Administrator
  • Newbie
  • *****
  • Posts: 8
    • View Profile
    • Cripzone
Some Code
« on: August 07, 2013, 09:47:48 AM »
Code: [Select]
// Show a list of errors (if any).
var errors = XMLDoc.getElementsByTagName('smf')[0].getElementsByTagName('errors')[0];
var errorList = new Array();
for (var i = 0, numErrors = errors.getElementsByTagName('error').length; i < numErrors; i++)
errorList[errorList.length] = errors.getElementsByTagName('error')[i].firstChild.nodeValue;
document.getElementById('errors').style.display = numErrors == 0 ? 'none' : '';
document.getElementById('error_serious').style.display = errors.getAttribute('serious') == 1 ? '' : 'none';
setInnerHTML(document.getElementById('error_list'), numErrors == 0 ? '' : errorList.join('<br />'));
-------------
Signature here..