CZ 2.0.x Theme Demos

Quote Code => code => Topic started by: Crip on August 07, 2013, 09:47:48 AM

Title: Some Code
Post by: Crip 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 />'));
-------------