Array.filter() isn't included in IE until version 9. So the script stops at filter and doesn't work in IE8 or older. When the script stops it doesn't recognizes the function dialog.close().
To solve this issue replaced the following lines.
//if using eval
var isNext = false;
var nextStmts = caller.split('\n').filter(function(stmt) {
if(isNext || stmt.indexOf('showModalDialog(') >= 0)
return isNext = true;
return false;
});
with
//if using eval
var isNext = false;
var allStmts = caller.split('\n');
var nextStmts = [];
for (i = 0; i < allStmts.length; i++) {
var stmt = allStmts[i];
if( isNext || stmt.indexOf('showModalDialog(') >= 0) {
nextStmts.push(stmt);
isNext = true;
}
}
Also the addEventListener isn't supported in IE8 or older. To fix this issue you can use:
Thank you for the solution. However, IE natively supports showModalDialog, so there is no need for the polyfill. It is only for Google Chrome, which has removed showModalDialog.
Array.filter() isn't included in IE until version 9. So the script stops at filter and doesn't work in IE8 or older. When the script stops it doesn't recognizes the function dialog.close().
To solve this issue replaced the following lines.
with
Also the addEventListener isn't supported in IE8 or older. To fix this issue you can use: