$('.ips').append(); $('#iprids').val(''); var iprids = ''; $('.loading').fadeIn('slow'); $('.loading').removeClass('loading'); var page = parseInt($('.grid').length/14)+1; var pattern = new RegExp('[?]'); var url = '/ipr/iprsjs/category/16/province/8.html'; if (pattern.test(url)) { $(".more a").attr("href", url+"&page="+page+ "&iprids=" + iprids); } else { $(".more a").attr("href", url+"?page="+page+ "&iprids=" + iprids); } if ($('.grid').length == "0") { $('.more').hide(); }