var zcats= ' var cats; if (err != "1"){ if (cats != "N") { if (document.getElementById("categories") != null) { document.getElementById("categories").innerHTML = zcats; } } }