Just copy your JS functions into a .js file and include it in the <head> section of your HTML documents:
<script type="text/javascript" src="mylibrary.js"></script>
The document.ready event will not be fired before all scripts connected in this way are loaded and executed, so all functions defined in it will be available when this happens.
To avoid hassle with other libraries, you can put all of your functions into a global object that serves as a namespace.
// mylibrary.js var myLibrary = { makeStartRefresher: function(refresh, refreshTime) { //function code }, readData: function(address){ //function code } ... }
and then when you use functions from your library, access them as follows:
myLibrary.makeStartRefresher(refresher, 1000);
source share