开发者

Javascript Dialog box appears in IE but not Chrome

开发者 https://www.devze.com 2023-04-11 03:01 出处:网络
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!:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号