DHTMLX Docs & Samples Explorer

URL Event

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.dhtmlx.com/</option></select></td>
        <td><input type="button" value="Attach URL" onclick="attachURL();"></td>
        <td><input type="button" value="Attach URL AJAX" onclick="attachURLAJAX();"></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/");
    dhxWins.attachEvent("onContentLoaded", function() {
        alert("onContentLoaded event fired.");
    });
    w1 = dhxWins.createWindow("w1", 20, 30, 520, 440);
    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);
}
function attachURLAJAX() {
    w1.attachURL("../common/attach_url_ajax_inner.html", true);
}
</script>