Run a javascript function on script load
Posted
by user188870
on Stack Overflow
See other posts from Stack Overflow
or by user188870
Published on 2010-03-17T15:17:39Z
Indexed on
2010/03/17
15:21 UTC
Read the original article
Hit count: 236
I am using jQuery. I keep all of my function definitions wrapped in the $(document).ready event in application.js. I have a function from it that I would like to call somewhere in the body of the page I am working on.
I was wondering if there is some alternative to the .ready event that will work on a script load. Ideally I would like to do something like: $('application.js').ready( call function );
In the jQuery documentation it only mentions the $(document).ready call but I was wondering if this can be altered or if there is some plain javascript alternative.
© Stack Overflow or respective owner