var btnScrollTop = { init: function() { $('body').append('
'); }, }; var obMain={ fbLike: function(idp,add){ $.ajax({ url: 'ajax/ajax_saveLike.php', method: 'post', dataType: 'json', data: {'idp':idp,'add': add?1:0}, success: function(r){ console.log(r.comm); } }); }, gLike: function(pr){ $.ajax({ url: 'ajax/ajax_saveLike.php', method: 'post', dataType: 'json', data: {'idp':31412,'add': pr.state=='on'?1:0,'gplus':1}, success: function(r){ console.log(r.comm); } }); } } function gLike(r){ obMain.gLike(r); }