简体   繁体   中英

Javascript Dialog box appears in IE but not Chrome

I have a Javascript function that opens up dialog box that works well in IE but in Chrome, it doesn't appears, please advice, thanks!:

Javascript:

function modalDialog() {

   window.Page_ClientValidate();


            if (window.Page_IsValid) {
                document.getElementById('dialog').style.display = 'block';
                document.getElementById('fade').style.display = 'block';

                $('#dialog_link').click(function() {
                $('#dialog').dialog('open');

                return false;
                });
            }

}

Dialog box:

<div id="dialog" class="white_content" title="Cam" >
   <tr><td>Some Info</td></tr>
</div>

CSS:

<style type="text/css">

        .white_content
        {
            display: none;
            background-image: url('../../Images/prompt_bg.jpg');
            position: absolute;
            top: 25%;
            left: 0%;
            padding: 0px;
            z-index: 1002;
            overflow: auto;
        }
    </style>

You have your

<tr><td>...</td></tr>

nested inside a div tag. Chrome might have a problem with that because its a pretty non-standard use of the document object model.

One thing that I can note right off that bat is your Html is invalid. <tr><td> can only be used in <table> . I also believe that you need to change window.Page_IsValid to

if (typeof(Page_Validators) != "undefined")

Correct me if i'm wrong. Cause I just might be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM