javascript - jquery function call on page both onload and onclick? -


i working on jquery calender need call function both on page load , on click. when page load first time should automatically call , execute function , 2nd time , onward should call through click. possible?? if yes please me.

   <script type="text/javascript">     $(document).ready(function(){       $("#fulldate").datepicker({          showon: "button",         buttonimage: "images/calender.jpg",         buttonimageonly: true,          onclose: function(datetext, inst) {         $('#year').val(datetext.split('/')[2]);         $('#month').val(datetext.split('/')[0]);         $('#day').val(datetext.split('/')[1]);     }       });   }); </script> 

$(document).ready(function(){   $("#fulldate").datepicker({     showon: "button",     buttonimage: "images/calender.jpg",     buttonimageonly: true,      onclose: function(datetext, inst) {         $('#year').val(datetext.split('/')[2]);         $('#month').val(datetext.split('/')[0]);         $('#day').val(datetext.split('/')[1]);     }   });   $("#fulldate").datepicker("show"); // run once. }); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -