Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Events not firing in modal window

Status
Not open for further replies.

skippy2007uk

Programmer
Aug 10, 2007
18
0
0
GB
In my web app I open a new window by calling window.showModalDialog

This page has a body onload event (which is window.print) - however, this event is not being fired.

If I call via window.open the print event works.

I also run a function call via window.setTimeout and this is not firing either when modal.

Does a modal dialog prevent events from running?

Many thanks,
skip
 
Does a modal dialog prevent events from running?
I'd say that it does... especially given your observations.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Thanks for your reply.

I've just tried again and the print event now works, I'm sure this didn't when I tried on Friday! Hmmm...!

But the window.setTimeout event (which directs the user to a timeout page) isn't - but I do hear a windows alert (similar to popup blocker alert) after the time period is up - but the modal window does not navigate to the timeout page.

I'm not convinced that the results I am seeing are consistent!
 
ok, digging a bit deeper and it does seem the events are firing.

The problem I have now is that in the modal window, I run a window.SetTimeout function which re-directs to a timeout page after a short amount of time. I use window.location.href to navigate the that page.

However, the timeout page is opening in a new window, rather than replacing the current URL in the modal window.

I have set <base target="_self"></base> in the modal window to stop new windows appearing during navigation, but the timeout function still opens a new window.

Any ideas?

Thanks in advance.
 
You will get more replies to JS questions in forum216

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Thanks - didn't spot that forum - will post there also.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top