【问题标题】:Jquery PopUp (using in MVC )showing in Chrome but not in IEJquery PopUp(在 MVC 中使用)在 Chrome 中显示但在 IE 中不显示
【发布时间】:2013-05-29 05:44:19
【问题描述】:
  <div id="dialog"></div>

    <table>


        <tr>
            <td style="text-align: right">

                   @Html.ActionLink("Craete New Set1", "CreateNewSet1", "ClaimAuditAdmin", null, new{ @class = "openDialog", data_dialog_id = "emailDialog", data_dialog_title = "Create New Claim Audit Set"})
            </td>
            <td>


</td>
        </tr>

  $.ajaxSetup({ cache: false });

  $(document).ready(function () {
      $(".openDialog").live("click", function (e) {
          e.preventDefault();
         // $(".divContainer")
          // $("<div></div>")
          $("#dialog")
             // .addClass("dialog")
              .attr("id", $(this).attr("data-dialog-id"))
              .appendTo("body")
              .dialog({
                  title: $(this).attr("data-dialog-title"),
                  close: function () { $(this).remove() },
                  modal: true,
                  height: 325,
                  width: 325,
                  draggable: true,
                  resizable: false,
                  position: 'center',
                  scrollable:false
              })

              .load(this.href);
      });

      $(".close").live("click", function (e) {
          e.preventDefault();
          $(this).closest(".dialog").dialog("close");

      });
  });

MVC 中的 Jquery PopUp 在 Chrome 中显示,但在 IE 中不显示。在 IE 中也没有显示问题。

【问题讨论】:

  • Javascript 控制台中是否有任何错误?

标签: asp.net-mvc jquery model-view-controller asp.net-mvc-4


【解决方案1】:

尝试一次,基本上,您首先从其他页面“加载”内容。

  $("#dialog")
  .load(this.href)
  .dialog({
          autoOpen: false
  }).open();

  var link = this.href;
  $("#dialog")
  .dialog({
          open: function (event, ui) {
                $(this).load(link);
            },
  });

【讨论】:

  • 它是在父窗口中打开页面,但不是作为模型弹出窗口。
猜你喜欢
  • 2018-03-07
  • 2023-03-17
  • 2015-01-11
  • 2012-09-16
  • 2012-02-04
  • 2017-09-21
  • 2011-09-21
  • 2012-02-06
  • 2018-10-09
相关资源
最近更新 更多