cbsistem wrote 14 lines
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.