Source Code



Ajax load content

  • anonymous
  • May 12' 14
  • Javascript
  • 471
  • 31
  • United States
function loadMoreCategory(ctid, page, listData, a, btnMore, textFree, textButton, loadMoreUrl){
	$("#a-loadMore").html('Loading...');
	jQuery.ajax({
				url:  domain+"category/loadMore",
				dataType: "json",
				type: "POST",
				data: {
						'cd' : ctid,
						'page' : page
					  },
				success: function(data) {
											if(data.success){
												var html = "";
												for(var i=0; i';
											        html +='
'; html +=''+data.rows[i]['name']+''; html +='
'; html +='
'; html +='
'; html +='
'; html +=''; html +='
'; html +='

'+data.rows[i]['name']+'

'; html +='
'; html +='
'; html +='

'+data.rows[i]['category_name']+'

'; html +='
'; html +='
'; html +='

'+data.rows[i]['content_name']+'

'; html +='
'; html +='
'; if(data.rows[i]['price']=='0.00'){ var price = textFree; } else { var price = data.rows[i]['sign']+' '+data.rows[i]['price']+',-'; } html +=' '+data.rows[i]['price']+',- '; html +='
'; html +=''; } $("#loadmoreClear").remove(); $('.'+btnMore).remove(); $('#'+listData).append(html); html = "
"; html += "
"; html += " "+textButton+""; html += "
"; html += ""; $('#'+listData).append(html); } else { $("#loadmoreClear").remove(); $('.'+btnMore).remove(); } } }); } function loadMoreCategoryBackup(ctid, page, listData, a, btnMore, textFree, textButton, loadMoreUrl){ $("#a-loadMore").html('Loading...'); jQuery.ajax({ url: domain+"category/loadMore", dataType: "json", type: "POST", data: { 'cd' : ctid, 'page' : page }, success: function(data) { if(data.success){ var html = ""; for(var i=0; i'; html += '
'; html += ' '+data.rows[i]['name']+''; html += '
'; html += '
'; html += '
'; html += '
'; html += ' '; html += '
'; html += '

'+data.rows[i]['name']+'

'; html += '
'; html += '
'; html += '

'+data.rows[i]['category_name']+'

'; html += '
'; html += '
'; html += '

'; html += '
'; html += '
'; if(data.rows[i]['price']=='0.00'){ var price = textFree; } else { var price = data.rows[i]['sign']+' '+data.rows[i]['price']+',-'; } html += ' '+price+' '; html += '
'; html += ''; } $("#loadmoreClear").remove(); $('.'+btnMore).remove(); $('#'+listData).append(html); html = "
"; html += "
"; html += " "+textButton+""; html += "
"; html += ""; $('#'+listData).append(html); } else { $("#loadmoreClear").remove(); $('.'+btnMore).remove(); } } }); }
  • Tags : ajax, loader
comments powered by Disqus



Category

Tag Linked