DHTMLX Docs & Samples Explorer

Attaching URL

Select URL
Source
<link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxwindows.css">
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxwindows_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxwindows.js"></script>
 
<script src="../../codebase/dhtmlxcontainer.js"></script>
 
<div>
<table>
    <tr>
        <td>Select URL</td>
        <td><select id="sel"><option>http://www.google.com/</option><option>http://www.yahoo.com/</option></select></td>
        <td><input type="button" value="Attach URL" onclick="attachURL();"></td>
    </tr>
</table>
</div>
<div id="winVP" style="position: relative; height: 500px; border: #cecece 1px solid; margin: 10px;"></div>
<script>
var dhxWins,
w1;
function doOnLoad() {
    dhxWins = new dhtmlXWindows();
    dhxWins.enableAutoViewport(false);
    dhxWins.attachViewportTo("winVP");
    dhxWins.setImagePath("../../codebase/imgs/");
    w1 = dhxWins.createWindow("w1", 20, 30, 320, 240);
    w1.setText("dhtmlxWindow");
    w1.button("close").disable();
}
function attachURL() {
    var obj = document.getElementById("sel");
    var url = obj.options[obj.selectedIndex].firstChild.nodeValue;
    w1.setText(url);
    w1.attachURL(url);
}
</script>