Web Dialog not firing a JavaScript function...
-
The block for the
show
(andshow_modal
,) methods seem to only work on PC with MSIE. Last I knew, Safari on Mac, ignored the block for these methods.An alternative, is to do it on the JS side with an onload event, attached to the document or body. There are several topics here that discussed this, and I recall ThomThom and TIG testing this issue on both platforms.
EDIT(Add links):
-
I prefer to not use the onload event, but instead use the event that triggers when the HTML DOM is ready. onloads wait until all the images and resources as loaded, but the DOM load triggers earlier. When using local files there might not be much of a noticeable difference, but in some cases you might get a visual glitch or lag before onload triggers.
-
Yes! You guys were absolutely right - it was the need for a delay which was causing the problem. As always, you guys are THE BEST!!!
Thomas, I notice you're located in Norway. We here in the US (and elsewhere I'm sure) are saddened by what has happened in Oslo. Please know that our thoughts are with you. Take care.
-
@thomthom said:
I prefer to not use the onload event, but instead use the event that triggers when the HTML DOM is ready. onloads wait until all the images and resources as loaded, but the DOM load triggers earlier. When using local files there might not be much of a noticeable difference, but in some cases you might get a visual glitch or lag before onload triggers.
So Thomas, might this be an opportunity to get started on the Ruby API Bugtracker?
-
@thomthom said:
I prefer to not use the onload event, but instead use the event that triggers when the HTML DOM is ready.
What was that event again? onReadyStateChange or onWebpageComplete ??
-
@dan rathbun said:
What was that event again? onReadyStateChange or onWebpageComplete ??
http://dean.edwards.name/weblog/2005/09/busted/
@jim said:
So Thomas, might this be an opportunity to get started on the Ruby API Bugtracker?
Oh -yea. Nearly forgotten about that. Please do fill in issues and get it started. I'll remember to being using it myself when I'm back from vacation.
@archtobe said:
Thomas, I notice you're located in Norway. We here in the US (and elsewhere I'm sure) are saddened by what has happened in Oslo. Please know that our thoughts are with you. Take care.
Appreciate it. I'm currently on vacation in Gøteborg and learned about it a little bit later that day when people started texting me asking if I was ok. Myself and my friends are all ok - as far as I'm aware. Still shocked about the coldbloodedness of this madman.
-
@thomthom said:
@dan rathbun said:
What was that event again? onReadyStateChange or onWebpageComplete ??
found it:
[onReadyStateChange event (MSIE 7+)](http://msdn.microsoft.com/en-us/library/ms536957(v)... which uses the [readyState property](http://msdn.microsoft.com/en-us/library/ms534359(v)
You can test for values "complete" (everything is loaded,) or "interactive" (if the document is ready for user interaction.) -
It's the
DOMContentLoaded
event I linked to... -
@thomthom said:
It's the
DOMContentLoaded
event I linked to...which doesn't work for MSIE (IE 9+ does have some domContent... Timing properties but the page must set to IE9 Standards mode.)
Did you see that author's addendum page? (It uses onReadyStateChange event for MSIE to avoid the separate script file.)
http://dean.edwards.name/weblog/2006/06/again/ -
Yes, one has to use a combo. If you look at the jQuery source you see the various methods they use to make it cross platform compatible.
onReadyStateChange
is used as a fallback for older IE versions. Mozilla, Opera, Webkit and newer IE useDOMContentLoaded
.
http://ie.microsoft.com/testdrive/HTML5/DOMContentLoaded/Default.html
Advertisement