Check documentation for the latest version of dhtmlxSuite Adding External Resource to Window DHTMLX Docs

Adding External Resource to Window

Accessing IFRAME Content

IFRAME content is a result of attaching URLs to layout/windows.

The follownig code is a code of the attached page inner.html:

<html>
    <head>
        <script>
            var msg = "";
            function myFunc() {
                alert(msg);
            }
</script> </head> <body> <div id="myDiv"> </div> </body> </html>

And a page, where page inner.html will attached to, has the next code:

// windows
var w1 = myWins.createWindow(id, x ,y, w, h);
w1.attachURL("inner.html");
// layout
dhxLayout.cells(id).attachURL("inner.html");
// accordion
dhxAcc.cells(id).attachURL("inner.html");
// tabbar
dhxTabbar.cells(id).attachURL("inner.html");

So to access IFRAME object - use the code:

var ifr;
// windows
ifr = dhxWins.window(id).getFrame();
// layout
ifr = dhxLayout.cells(id).getFrame();
// accordion
ifr = dhxAcc.cells(id).getFrame();
// tabbar
ifr = dhxTabbar.cells(id).getFrame();

And to access functions/variables/objects - use the code:

ifr.contentWindow.msg = "Popup message";
ifr.contentWindow.myFunc();
ifr.contentWindow.document.getElementById("myDiv").innerHTML = "Object on page";
Back to top