Chrome 37已停止对showmodaldialog的支持.用什么代替它? [英] Chrome 37 has stopped showmodaldialog support.What is use instead of that?

查看:108
本文介绍了Chrome 37已停止对showmodaldialog的支持.用什么代替它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动Chrome新版本(37及更高版本)后,我的Web应用程序崩溃了,因为chrome停止了对showmodaldialog的支持.但是,我需要在我的Web应用程序中实现相同的功能.

My web application is crashed after launched of Chromenew version(37 and above),since chrome has stopped the support of showmodaldialog.However i need to implement same functionality in my web application.

我需要与showmodaldialog相同的弹出窗口中的return value.我已经单独设计了所有弹出页面,并从父页面中调用了它们.

I need some return value from popup same as showmodaldialog.I have designed all the popups page separately and called them from the parent page.

推荐答案

经过大量的搜索后,我找到了解决该问题的方法.我使用的是jquery-1.9.1版本中的Jquery dialog.下方:

After doing lots of googling , i have find out the solution of that issue.I am using Jquery dialog present in jquery-1.9.1 version.The implementation of given below:

在父页面的head标记上添加jquery

Add jquery library on head tag of the parent page

<link type="text/css" rel="stylesheet" href="https://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>

编写弹出窗口打开功能,在其中创建一个div并在div内部使用iframe这样

Write the popup opening function,where i am creating a div and inside the div take iframe like this

<script type="text/javascript" language="javascript">
 function Open() {

        var href = "../../PopUps/FindEmployee.aspx?Page=EC";
        var obj = $('<div id="divClose"></div>');

        obj.html('<iframe id="popUpFrame" style="border: 0px; " src="' + href + '" width="100%" height="99%"></iframe>');
        obj.dialog({
            autoOpen: false,
            resizable: false,
            height: 500,
            width: 650,
            modal: true,
            title: "Find Employee",
            dialogClass: 'infoDialogHeader infoDialogTitle'
        });
        obj.dialog('open');
        return false;
    }
 function closeIframe() {
        $('#divClose').dialog('destroy');
    }


</script>

现在,我正在处理像这样的FindEmployee.aspx子页面:

Now I am working on child page which is FindEmployee.aspx like ths:

<script type="text/javascript" language="javascript">

    $(document).ready(function () {

        $("[id^=BtnReturnParentPage]").click(function (e) {
            var movedElement;

            if ($("#hdnInformationType").val() == "EC") { // condition for Employee Code                   
                movedElement = window.parent.$("[id*='txtECode']");
                // cleaning textbox
                movedElement.val('');
                movedElement.val($(this).parent().parent().find("[id^=gvEmployeeDetails_gvlblEmployeeCode]").text()); // assing relating information
            }

   window.parent.closeIframe();

        });

</script>

在上面的子页面代码中,我具有父页面上存在的$("[id*='txtECode']") textbox值,并将子页面员工代码值分配给父页面textbox.

In above child page code , i have take value of $("[id*='txtECode']") textbox which is exist on parent page , and assign child page employee code value to parent page textbox.

因此,我们需要在父页面上创建一个名称为txtECodetextbox元素,以便分配子页面的值.

So we need to create an element of textbox with name of txtECode on parent page so that assign the value of child page.

希望它可以帮助所有正在为window.showmodeldialog

Hope it helps all the people who is struggling with window.showmodeldialog

这篇关于Chrome 37已停止对showmodaldialog的支持.用什么代替它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆