Script to run at completion of Page Loading

On the home page I a have 2 lines of code I would like to run in JavaScript.

Where should I put these two lines of code.

Does WP have a specific way to do this. Or should I just pick the last .js file that loads and add it there?

2 s
2

yes, WordPress has a function for loading javascript files:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script

the last argument takes either true or false to load in the footer

Leave a Comment