The "window.showModalDialog" function exists in some versions of IE, but does not exist in Chrome, I would like to insert it if it does not exist. How can I do this?
window.showModalDialog = function (arg1, arg2, arg3) {
//Minha função
}
The "window.showModalDialog" function exists in some versions of IE, but does not exist in Chrome, I would like to insert it if it does not exist. How can I do this?
window.showModalDialog = function (arg1, arg2, arg3) {
//Minha função
}
This feature is not standardized, deprecated, and should be avoided .
I think you put different issues here, and interesting to separate.
You can detect if the function exists and if you do not apply a function of yours with similar behavior. Something like:
if (!window.showModalDialog) window.showModalDialog = function(){
// etc ...
This already exists and you can find it in Github here: link
MDN also points to this repository that has a demo here .