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
Post a Comment