I am having strange behaviour on my Android emulator. window.open() always returns undefined when called from setTimeout or callback function e.g. AJAX callback. However window.open() successfully opens a popup when called from an event handler e.g. onclick here is sample code:
<html>
<head>
</head>
<body>
<script type="text/javascript">
function fnc()
{
setTimeout(function() { alert(window.open('about:blank')) }, 100);
}
</script>
<input type="button" onclick="fnc()" value="push me">
</body>
</html>
In the example alert(window.open('about:blank')) shows 'undefined' and the popup is not created The same function works when called straight from fnc()
Any ideas?
Thanks