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.
精彩评论