F
Fred Basset
I am modifying existing code to add modal functionality to an IE5+
ActiveX Web-App. What I am trying to achieve is simple modal behaviour
on popup windows, apart from certain specified ones. I initially
attempted to use a direct assignment to the onblur handler of the new
window, but for some reason couldn't get it to work, so I've instead
used attachEvent. This provides simple modal functionality.
The problem that I need help with is that for some reason the attached
event handlers die when the page is reloaded or goes to another page.
I'm a little surprised as I would expect the global window event handler
to carry across reloads or location changes, and that's why I'm asking
for your help!
<script type="text/javascript">
var wOpen = null;
function DoNewWindow( sUrl, sTitle, sStyle, iWidth, iHeight )
{
wOpen = window.open(sUrl,sTitle,sStyle);
var bIsModal = true;
switch ( sTitle )
{
case 'Help' :
case 'UserAdmin' :
case 'Account' :
bIsModal = false;
break;
default :
break;
}
if ( bIsModal )
{
wOpen.attachEvent( 'onload', wOpen.focus );
wOpen.attachEvent( 'onblur', wOpen.focus );
}
}
</script>
Fred Basset
(e-mail address removed)
ActiveX Web-App. What I am trying to achieve is simple modal behaviour
on popup windows, apart from certain specified ones. I initially
attempted to use a direct assignment to the onblur handler of the new
window, but for some reason couldn't get it to work, so I've instead
used attachEvent. This provides simple modal functionality.
The problem that I need help with is that for some reason the attached
event handlers die when the page is reloaded or goes to another page.
I'm a little surprised as I would expect the global window event handler
to carry across reloads or location changes, and that's why I'm asking
for your help!
<script type="text/javascript">
var wOpen = null;
function DoNewWindow( sUrl, sTitle, sStyle, iWidth, iHeight )
{
wOpen = window.open(sUrl,sTitle,sStyle);
var bIsModal = true;
switch ( sTitle )
{
case 'Help' :
case 'UserAdmin' :
case 'Account' :
bIsModal = false;
break;
default :
break;
}
if ( bIsModal )
{
wOpen.attachEvent( 'onload', wOpen.focus );
wOpen.attachEvent( 'onblur', wOpen.focus );
}
}
</script>
Fred Basset
(e-mail address removed)