oFriends= { ‘sijo’:1,’ajo’:2,’rijo’:3 } var count = Object.keys(oFriends).length;
Category: jQuery
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>
fancybox custom css class
<script type=”text/javascript”> jQuery(document).ready(function(){ jQuery.fancybox.open({ href: ‘<?php echo $this->baseurl(); ?>/user/index/verifypopup’, type: ‘ajax’, wrapCSS : ‘fancybox-emailverify’, closeBtn : false, helpers : { overlay : {closeClick: false, css: {‘z-index’: ‘8010 !important;’} } }, keys : { close : null } }); }); </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 //…