Javascript source
var xmlHttp = null;
var url = "https://www.bedug.com/x4a.html";
function loadcontent()
{
xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = ProcessRequest;
xmlHttp.open( "GET", url, true );
xmlHttp.send( null );
}
function ProcessRequest()
{
var el = document.getElementById("content");
var ifrDoc = el.contentWindow.document;
if ( xmlHttp.readyState == 4)
{
if ( xmlHttp.status == 200 )
{
ifrDoc.open();
ifrDoc.write(xmlHttp.responseText);
ifrDoc.close();
} else {
ifrDoc.open();
ifrDoc.write("<h2 style=\"background: red;\">Error " + xmlHttp.status + "</h2>");
ifrDoc.write("<p>The resource <b>url+"<b> couldn't be loaded!<p>
ifrDoc.close();
}
}
}