Atozed Forums
Execute JS in template - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Execute JS in template (/thread-1201.html)



Execute JS in template - matija - 08-22-2019

In my HTML template i have JS function.

function openNav(){
...
}

procedure TForm1.IWAppFormShow(Sender: TObject);
begin

InitAddProc('openNav();');

end;

This not work?


RE: Execute JS in template - Jose Nilton Pace - 08-22-2019

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>



RE: Execute JS in template - matija - 08-23-2019

(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