[Pas2js] Error attributes to Event: TJSMouseEvent;
Michael Van Canneyt
michael at freepascal.org
Tue Mar 23 11:50:17 CET 2021
On Mon, 22 Mar 2021, cbsistem via Pas2js wrote:
>
>
> my verion of trunk Pas2JS Compiler version 2.1.1 [2021/03/22] for Linux
> x86_64
>
>
> //this event is NEVER RUN, even if it is linked Link.onclick: = @
> DoLinkClick;
> -------------------------------------------------------------------------------------------------------------------
> function TDemoForm.DoLinkClick(aEvent: TJSMouseEvent): boolean;
> begin
>
> Router.Push(string(aEvent.target['href'])); // not executed
> end;
It is executed here.
But the logic in that routine was wrong of course, only the part after the # should be used.
To show that it is actually the event that does the routing (which is
actually not needed for the <a href=""> tag) I added a preventDefault and
some logging.
Michael.
More information about the Pas2js
mailing list