IE9中的jQuery Dialog问题

时间:2013-12-05 15:02:04

标签: jquery dialog internet-explorer-9

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <link href="themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <link href="includes/jquery.cluetip.css" rel="stylesheet" type="text/css" />
    <script src="includes/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.core.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="includes/jquery.cluetip.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.mouse.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.draggable.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.position.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.resizable.js" type="text/javascript"></script>
    <script src="includes/jquery.ui.dialog.js" type="text/javascript"></script>
    <script src="includes/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script>

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

 function ClosePopUp() {
     $('#dialog').dialog('close');
     var NewModelNo = $('#hdnModelNumber').val();
     $("#ddlModelNumber option[value='" + NewModelNo + "']").attr("selected", "selected");
     $('#ddlModelNumber').change();
     return true;
 }


    $(function ()  { 
         var buttons = $('.ui-dialog-buttonpane').children('button');
         buttons.remove();
         $('#dialog').append(' <br/>'); 
         $('#dialog').dialog({      
         title: '<span class="modalpopup-title">Model Renamed</span>',
         modal:false,
         height:250,
         width:560,
         position:'top',
         autoOpen:false
         });
         $("#ddlModelNumber").bind('change', function (e) {
         e.preventDefault();
         ModelPopup();  
        });             
     });
    function ModelPopup() { 
             var ModelNo = $('#ddlModelNumber :selected').val();
             var NewModelNo = $('#hdnModelNumber').val();
             if (ModelNo == NewModelNo) {
                 return true;
             }
             jQuery.ajax({
                 type: 'POST',
                 contentType: 'application/json; charset=utf-8',
                 data: "{ 'ModelNo': '" + ModelNo + "' }",
                 dataType: 'json',
                 url: 'product-registration.aspx/CheckConflicts',
                 success: function(result) {
                     if (jQuery.trim(result.d).length > 0) {
                         $('#dialog').text('');
                         var NewModelNo = result.d;
                         $('#hdnModelNumber').val(NewModelNo);
                         var content = "<span class='modalpopup-content'>The model " + ModelNo + " has been renamed to " + NewModelNo + " so " + NewModelNo + "<br/>"
                         content += "has been selected in the Model drop down menu.</span>";
                         $('#dialog').append(content); //message to display in divmessage div
                         $('#dialog').append('<br/> <br/><a><img src ="images/sp_int_closeWindow_btn.gif" alt ="Close" onclick="javascript:return ClosePopUp();" id="messagego" /></a>');
                         $("#dialog").attr("style", "font: 11px; font-family: Arial; font-weight: bold;visibility:visible;");
                         $('#dialog').dialog('open');
                         return false;
                     }
                 }
             });
             return true;
 }

             

以上代码在chrome中运行良好,但在IE中引起了奇怪的问题。它实际上表现不一致。总结一下,当页面第一次加载时,在更改下拉列表弹出窗口时不会出现库中的一些错误(很少),如果我刷新页面对话框出现。请帮忙!!!!

0 个答案:

没有答案