Hmm, well it's a workaround but maybe one of you OLE gurus
could tell me the proper way to do it? Thanks.
In my HTML document, a JavaScript function:
function GetEventObject()
{
document.all('event_id').innerHTML = window.event.srcElement.id; document.all('event_type').innerHTML = window.event.type; } and some *hidden* span tags with the respecitve ID attributes:
event_id and event_type. Okay, in my Perl code:
sub DocumentComplete {
$ie->Document->{onclick} = Win32::OLE->Forward(sub { $ie->Document->parentWindow->execScript('GetEventObject()', 'JavaScript'); print
$ie->Document->All('event_id')->{innerHTML}, " : ",
$ie->Document->All('event_type')->{innerHTML},
"\n";
}); } The goal is to create a Perl event handler that can handle
bubbled events from the HTML document. This will work if I add the JavaScript
function and HTML to every document but it's not a clean solution. I want my
Perl handler to be independent of the web sites content (HTML).
Much obliged to anyone who might share the appropriate Perl
code to obtain the event object.
Thank you,
Michael % )
|
- Win32::OLE & Browser Event Object Michael Nino
- Michael Nino