2015-04-02 44 views
-1

你知道如何调用外部文件插入到Metro ui框架的对话框中。我在这里跟着文档:http://metroui.org.ua/dialog.html 但它没有显示如何调用外部文件,如.html或.php。请你能帮助我的建议或解决方案。谢谢用metro ui调用其他文件的html JS Dialog

+0

您可以在'onShow'中使用AJAX调用获取内容,并将返回的数据设置为对话框的内容。 – anpsmn 2015-04-02 06:06:29

+0

@anpsmn你可以给链接一个例子吗? – Ilham 2015-04-02 06:12:29

回答

1

您可以进行ajax调用并将结果设置为onShow事件对话框的内容。 [source]

$("#createFlatWindow").on('click', function(){ 
    $.Dialog({ 
     overlay: true, 
     shadow: true, 
     flat: true, 
     icon: '<img src="images/excel2013icon.png">', 
     title: 'Flat window', 
     content: '', 
     onShow: function(_dialog){ 
      $.ajax({ 
       url: "test.php", 
       dataType: "html", 
       success: function(result){ 
       var html = result; 
       $.Dialog.content(html); 
       } 
      });    
     } 
    }); 
}); 
+0

伙计们其外部页面成功加载,但为什么会出错?对话框无法关闭。请帮助我,我已经困惑 – Ilham 2015-04-02 06:37:50

+0

什么是错误? – anpsmn 2015-04-02 06:38:45

+0

没问题的家伙,我忘了放东西。谢谢你的帮助 – Ilham 2015-04-02 09:28:00