分页不工作laravel

时间:2014-02-26 06:53:03

标签: php jquery ajax json laravel-4

function car_images() { 
    var searched_car_results = carInfo.length; 
    $("#car_list").empty(); 
    $("#div_header_result_count").empty(); 
    $("#div_middle_result_count").empty(); 
    $("#div_pagination").pagination ({ 
        items: searched_car_results, itemsOnPage: 10, 
    }); 
    var i,j,chunk = 10; 
    var temp_array = new Array(); 
    var k=0; 
    for (i=0,j=carInfo.length; i<j; i+=chunk) { 
        temp_array[k] = carInfo.slice(i,i+chunk); // do whatever 
    } 
    $.each(temp_array[k], function(index, element) { 
       var rows = '<div class="offer_item clearfix" id="div_offer_image"><div class="offer_image"><a href="/cardetails/'+element.brand_name+'-'+element.model+'"><img src="/images/car_images/thumbnails/'+element.color_img +'" alt=""></a></div><div class="offer_aside"><h2><a href="/cardetails/'+element.brand_name+'-'+element.model+'">'+element.brand_name+' '+element.model+' - '+element.version+'</a></h2><div class="offer_descr"><p>'+ element.description +'</p></div><div class="offer_data"><div class="offer_price">Cost: '+ element.price +'</div><span class="offer_mileage">'+ element.mileage +' </span><span class="power">' + element.power +'</span></div></div></div>';
       $("#car_list").append(rows); }); 
       $("#div_header_result_count").append("<h1>Showing<span> " +searched_car_results+"&nbsp;RESULTS </span>for your search</h1>"); var rows1 = '<div class="container"><p><a href="/">Home</a><span class="separator">&rsaquo;</span> <a href="/browsecars_1">Browse Cars</a><span class="separator">&rsaquo;</span> <span class="current">'+searched_car_results+' Results</span></p><a href="/browsecars_1" class="link_search">Start a New Search</a></div>' 
       $("#div_middle_result_count").append(rows1); 
    }

0 个答案:

没有答案