I have a jsp page in which rows are created dynamically to a table using java script. It is working fine in all the browsers except IE. In IE it is showing the error Unknown
My problem was it worked in firefox and did not work in IE know am using multipe tables and forms inside each other ...
General solution
Use JQuery it can solve such issues between browsers in my case i faced this error and replaced with the $('#'+loc).html(ddl) line instead of innerHTML and it worked
function buildDDL(){
if (http_request.readyState == 4)
{
var ddl = http_request.responseText;
ddl = ddl.replace(/[\n]/g, '');
if(ddl != 'SESSION_EXPIRED'){
$('#'+loc).html(ddl);
//document.getElementById(loc).innerHTML = ddl;
}else{
location.href = 'errorPage.jsp?status='+ddl;
}
http_request = false;
}
}
If you're wondering about functionality, then jQuery's html() performs the same intended functionality as innerHTML, but it also performs checks for cross-browser compatibility.
For this reason, always use jQuery's html() instead of innerHTML where possible.