javascripthtmlmetro-ui-cssmetro.js

Call other file html with metro ui JS Dialog


Guys do you know how to call external file for insert to dialog with Metro ui framework. I have followed docs here: http://metroui.org.ua/dialog.html But its not showing how to call external file like .html or .php. Please can you help me advice or solution.thanks


Solution

  • You can make an ajax call and set the result as content for the dialog on onShow event. [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);
                   }
                 });            
            }
        });
    });