cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute js function in body onload

kasaba_
Champ in-the-making
Champ in-the-making

Hi, fellows

I have a js function which I want to be execute in

Is it possible to do that?

Thanks in advance.

1 ACCEPTED ANSWER

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Easiest way to achieve that is to use jQuery:

  <script>
    jQuery(document).ready(function() {
      // javascript to execute on load
    });
  </script>

View answer in original post

3 REPLIES 3

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Easiest way to achieve that is to use jQuery:

  <script>
    jQuery(document).ready(function() {
      // javascript to execute on load
    });
  </script>

And to include that easily I think the easiest way it to add this javascript fragment in a dedicate javascript file for instance name it myfunc.js

http