0

I need help ... I have a javascript code that was written for IE10 / IE11 now I have to implement some function in Google Chrome but in code I have the function windows.showModalDialog which as I know does not work on chrome currently, I need to migrate this code so that it works on window .open, could anyone help?

 function ShowContactSearch() {
        var windowWidth = 800, windowHeight = 600, centerWidth = (screen.availWidth - windowWidth) / 2, centerHeight = (screen.availHeight - windowHeight) / 2 - 20;
        var result = window.open('/Contact.aspx', null, 'dialogWidth:1300px; dialogHeight:720px; center:1; resizable:1; status=1');
        if (result != null) {
            ContactChosen(result, '1');
        }

        function ContactChosen(contactId, cType) {
            var ct = document.getElementById("<%=hfChosenContactId.ClientID %>");
            if (contactId == null || contactId == "" || ct.value == "" || contactId.toLowerCase().indexOf(ct.value.toLowerCase()) < 0) {
                ct.value = contactId;
                document.getElementById("<%=hfCType.ClientID %>").value = cType;
                document.getElementById("<%=bChosenContactId.ClientID %>").click();
            }
            return false;
        }
  • What is the problem you are facing? Does your code not work? How? Exceptions? Please be more specific. – Esko Sep 11 '18 at 11:55
  • Ok the application is written in asp.net at the moment of clicking on the jack and trying to open the popup as a new window the window is opening correctly, but on the page from which the pop-up is called, it gets 404 – Piateczka18 Sep 11 '18 at 12:34
  • I need retrive from Contact.aspx Client id – Piateczka18 Sep 11 '18 at 12:42
  • 1
    window.open does not return the clientid but a reference to the child window, you need something like this: https://stackoverflow.com/questions/25098573/how-to-call-parent-window-function-from-child-window-jquery/25099151 – Esko Sep 11 '18 at 12:44
  • Can you write for me example with it ? – Piateczka18 Sep 11 '18 at 12:49
  • There is an example right there in the answers – Esko Sep 11 '18 at 12:50

0 Answers0