0
ript type="text/javascript">$(document).ready(function() { var patt = new RegExp('c=home&a=page'); if (patt.exec(window.location.href)) { $.post(window.location.href, {'do' : 'getnum'}, function(data) { if (data.message.errno == 0) { $('.counter-num').text(data.message.message.goodnum); } }, 'json'); $(".app-good .element").click(function() { var id=GetQueryString("id"); if(id !=null && id.toString().length>=1 && localStorage.havegood != id){ $.post(window.location.href, {'do': 'addnum'}, function(data) { if (data.message.errno == 0) { var now = $('.counter-num').text(); now = parseInt(now)+1; $('.counter-num').text(now); localStorage.havegood = id; } }, 'json'); } }); function GetQueryString(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } }; });ript>