Events on new window
Hi
I used activex object to open the application in IE. That always opens ina new window. My requirement is that I need to attach event listener to that child window. I can make it close by calling quit method. But instead of window.attachEvent if I use Explorer.attachEvent then it throws error. Is there any way I can get control of the child window or a way i can open it in the same window and attach events?
Please help.
Part of my code is like below:
<Script LANGUAGE="JavaScript">
var Explorer;
function openIE()
{
Explorer = new ActiveXObject("InternetExplorer.Application");
Explorer.Navigate("http://google.com");
Explorer.Visible = true;
//Explorer.Quit();
}
function closeIE(Explorer)
{
Explorer.Quit();
}
function statusreport(){
alert("statusreport");
}
if (window.attachEvent)
{
window.attachEvent("onload", statusreport)
window.attachEvent("onkeypress", showit)
}
function showit()
{
alert("event.x: "+event.x)
alert("event.y: "+event.y)
}
document.onclick=showit;
</Script>
|