code for playing on loading document in page js code example Example: call a function on load jquery $(document).ready(function () { // Function code here. });