Page 1 of 1

Load Webpage in a window or dialog

Posted: Thu Dec 20, 2018 11:59 am
by r3mi
Hello I am building an admin dashboard for my product. I am having trouble calling a url other than youtube in a window.
I want my webpage to load immediately the create...() function is called.

function createWindowFBPage(){
Desktop.createWindow({
width: 500,
icon: "<span class='mif-facebook'></span>",
title: "Facebook",
content: "",
onShow: function(_dialog){
$.ajax({
url: "https://www.facebook.com/",
dataType: "html",
success: function(result){
var html = result;
$.Dialog.content(html);
}
});
}
clsContent: "bg-dark"
});
}

Re: Load Webpage in a window or dialog

Posted: Thu Dec 20, 2018 1:59 pm
by olton
At this time dialog has a minor problem with event onShow. But you can use next method:
https://sandbox.org.ua/olton/code/j1Rbaevbd8

P.S.
To load facebook page, you must use an iframe, because of you receive X-Cors error otherwise.

P.S.2
https://metroui.org.ua/dialog.html# Read the dialog docs. You use syntax from Metro UI 3, but in Metro 4 dialog component was rewritten.

Re: Load Webpage in a window or dialog

Posted: Fri Dec 21, 2018 6:49 pm
by olton
Hi! I fix onShow event in the develeop branch 4.2.32
https://sandbox.org.ua/olton/code/yExZ0D9ZP2