PDA

View Full Version : exception that does not get into error console



BubikolRamios
11-22-2012, 10:49 AM
var divArrayA = document.getElementsByClassName("edit_control");
var divArrayB = document.getElementsByClassName("display_control");
var divArray;
try
{
divArray = divArrayA.concat(divArrayB);
}
catch(err)
{
txt="There was an error on this page.\n\n";
txt+="Error description: " + err.message + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}


alert pops up: "divArrayA.concat is not a function"

if there were no try ..except, there would be no effect and nothing in error console.

What is wrong here ?

BubikolRamios
11-22-2012, 11:04 AM
document.getElementsByClassName


OK, my bad, red part has nothing to do there, but strange that there is no error on that part in error console.