Atozed Forums

Full Version: Execute JS in template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my HTML template i have JS function.

function openNav(){
...
}

procedure TForm1.IWAppFormShow(Sender: TObject);
begin

InitAddProc('openNav();');

end;

This not work?
Hi Matija. If you are going to execute a JS function right after FormShow, why not do it in the template itself when it's ready?
Code:
<head>
  <script>
    $(function(){
      openNav();
    });
  </script>
</head>
(08-22-2019, 05:51 PM)Jose Nilton Pace Wrote: [ -> ]Hi Matija. If you are going to execute a JS function right after FormShow, why not do it in the template itself when it's ready?
Code:
<head>
  <script>
    $(function(){
      openNav();
    });
  </script>
</head>

This also work. Thx