The project that i am trying to fix was based on IE. At one of the pages users will get city name and city code from an opened pop-up page. Those values will pass from pop-up page to current page. There is no problem by doing this while using IE. However if they want to use Microsoft-Edge, that city name and city code will not pass. When I debug the related javascript code in both Microsoft-Edge and IE, I have noticed some problems.
if (window.showModalDialog) {
returnValue = window.showModalDialog(adress, window, "dialogWidth:700px; dialogHeight:500px; status:no; center:yes; resizable:yes; scroll;yes");
}
else {
returnValue = window.open(adress, "newWindow", "width=700, height=500, top=150, left=150, status=no, resizable=yes, scroll=yes, toolbar=no, scrollbars=yes, menubar=no, location=no");
}
if (returnValue == null) returnValue = "";
if (returnValue != "") {
var split2 = returnValue.split("£");
window.document.getElementById(knt + "txtKod").value = split2[0];
/*
...................................
*/
}
In this piece of code; IE fires returnValue
under if (window.showModalDialog)
and a pop-up page is opened. It allows users to select city code and city name and passes those values to current page with this returnValue
. However, in Microsoft-Edge, that returnValue
returns undefined
and it fires the returnValue = window.open
in else
section. But in this time it does not wait users to select city name and city code and it passes to if (returnValue == null) returnValue = "";
section. So, returnValue eventually does not return an expected value. What I wonder is, are there any alternative for window.showModalDialog
and window.open
or do I need to add something.