dhtmlxWindow attachurl check if empty page is displayed

Hi,

Is there any way to check (via code) if an url I attached displays an empty page?
I’m using dhtmlxWindow.

<tr><td><div id='winGeg'></div></td></tr>
<script>
byId("winGeg").style.display="block";
if (dhxWins != null && dhxWins.unload != null) {
	dhxWins.unload();
	dhxWins = win = null;
}
var dhxWins, win;
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo("winGeg");
win = dhxWins.createWindow("win", 0, 0, 500, 150);
win.setText("Some text");
win.button("park").disable();
win.button("minmax").disable();
win.button("minmax").hide();
win.button("park").hide();
win.setIconCss("without_icon");
dhxWins.window("win").denyMove();
dhxWins.window("win").denyPark();
dhxWins.window("win").denyResize();
win.attachURL("somepage.php", true);
</script>

So if the attached url returns an empty page, I want to hide the window. If it has some values, I want the window to show up (shows up by default).

Please check here docs.dhtmlx.com/windows__attach_ … hedcontent

Sorry for my late reply. I don’t get it working…

I want to validate the text received from somepage.php and if it is empty, hide the window.

Don’t use attachURL in such a case.

Instead, use dhx.ajax to fetch data from a remote url, check data, and if it is valid, use attachHTMLString API to set content of the window.

Interesting approach, thx!