Re: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Thu, 11 Jan 2007 14:01:29 -0500
Lady_A <alexandra.lev@xxxxxxxxx> wrote:
I've hooked into the onunload event of IHTMLWindowEvents2 which has
the IHTMLEventObj as an in param.
My goal is to retrieve the URL of that window that triggered my
onunload.
The following code results in event_source beung NULL, meaning the
srcElement of the HTMLEventObj is NULL.
Why is that ?
By design. For each event, MSDN documentation lists all the properties
of the 'event' object that are valid for this particular event.
srcElement is not valid for onunload event.
How do I retrieve the URL from my onunload sink ?
onunload event doesn't bubble. You already know which element it is
coming from - the very same element you attached your sink to in the
first place. Read URL from that element.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- Prev by Date: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- Next by Date: How can I get the event when zoom percent is changed in IE7
- Previous by thread: Calling get_srcElement on IHTMLEventObj puts NULL in the srcElement
- Next by thread: How can I get the event when zoom percent is changed in IE7
- Index(es):
Relevant Pages
|
|