oFriends= { ‘sijo’:1,’ajo’:2,’rijo’:3 } var count = Object.keys(oFriends).length;
Category: javaScript
How to get current time with jQuery?
<script type=”text/javascript”> var TodayDate=new Date(); var currentHours = TodayDate.getHours(); var currentMinutes = TodayDate.getMinutes(); var currentSeconds = TodayDate.getSeconds(); </script>
prevent parent click event
<script type=”text/javascript”> jQuery(‘#friendul’).click(function(e) { e.stopPropagation(); });
Signup or login through facebook
<div><a href=’javascript:void(null);’ onclick=”login();”>Signup/ login through facebook</a></div> <div id=”fb-root”></div> <script src=”http://connect.facebook.net/en_US/all.js”></script> 1. Include the above facebook all.js first. <script> 2. Initialize the facebook app settings. jQuery(function() { FB.init({ appId : ” <12356666>”, status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true //…
scroll to top of a page
window.scrollTo(0,0);