ShowModalDialog quick upgrade solution, showmodaldialog

Source: Internet
Author: User

ShowModalDialog quick upgrade solution, showmodaldialog

The original website used showModalDialog to pop up the box and PASS Parameters. It was not powerful in chrome and other browsers, and its compatibility was too poor. Therefore, the js layer was quickly upgraded.


1. on the original pop-up page, delete the old parameter passing code and leave a hidden record parameter.

2. Delete the old receiving parameter code from the parent form

# Selectinfo is the id of hidden. If you select a parameter to close the child form, the parameter is triggered to pass to the parent form.
 <script src="js/jquery-1.8.3.js" type="text/javascript"></script>    <script src="js/layer/layer.min.js" type="text/javascript"></script>    <script type="text/javascript">        $(function () {            $('#btn_addname').click(function () {                $.layer({                    type: 2,                    shadeClose: true,                    title: false,                    closeBtn: [1, true],                    shade: [0.6, '#000'],                    border: [0],                    offset: ['20px', ''],                    area: ['242px', ($(window).height() - 25) +'px'],                    iframe: { src: 'SelectPerson.aspx' },                    close: function (index) { document.getElementById("receivername").value = layer.getChildFrame('#selectinfo', index).val(); }                });            });</script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.