2017-03-28 11 views
-2

ボタンをクリックすると、ajaxは新しいコンテンツを読み込む必要があります。ユーザーが新しい読み込みコンテンツの上にスローする必要があります.MozillaとIEでは完全に機能しましたが、問題がどこにあるのか知りません。前もって感謝します。私のjsは別のブラウザで動作しますが、クロムでは動作しません

if ($showMoreOffersButton) { ?> 
     <div class="text-center box" id="show-more-tourism-offers-btn-holder"> 
      <a class="site-button blue" onclick="showMoreTourismOffers(<?php echo $offset; ?>)" 
       onclick="ga('send', 'event', '<?= isset($parent_component) ? $parent_component : 'Unknown' ?>', 'Show More Offers');"> 
       <span class="glyphicon glyphicon-refresh spinning" id="travel-arrow-spinner" 
         style="display: none"></span> 
       ОЩЕ ОФЕРТИ 
      </a> 
     </div> 
    <? } 



function showMoreTourismOffers(begin_offset) { 
if (!btn_lock) { 
    //check if user already visited this page and saw more than 16 boxes 
    if (offset < begin_offset) { 
     offset = begin_offset; 
    } 
    var mobileFlag; 
    if(isMobile == 1){ 
     mobileFlag = true; 
    }else{ 
     mobileFlag = false; 
    } 
    $.ajax({ 
     url: base_url + 'pochivki/show_more_offers/', 
     type: 'POST', 
     data: { 
      filter: ajaxDealFilter(true, mobileFlag), 
      country_index: countryIndex, 
      region_index: regionIndex, 
      city_index: cityIndex, 
      offset: offset, 
      current_url: window.location.href 
     }, 
     success: function (data) { 
      $('#tourism-deals-holder').append(data.deals); 
      if (data.hideButton) { 
       $('#show-more-tourism-offers-btn-holder').remove(); 
      } 
      offset += 48; 
      $('#travel-arrow-spinner').hide(); 
     }, 
     error: function() { 
     }, 
     beforeSend: function() { 
      btn_lock = !btn_lock; // becomes true 
      $('#travel-arrow-spinner').show(); 
     }, 
     complete: function() { 
      btn_lock = !btn_lock; // becomes false again 
      $('.images-rotation').imagesRotation() 
     }, 
     dataType: "json" 
    }); 
} } 
+0

すべてのエラーを持っている誰のこのヘルプを願って、この問題を解決しますか? – Timo

+2

ChromeでF12キーを押し、コンソールタブに移動 – j08691

+0

コンソールに何もない – Darina

答えて

-1

私は同じ問題

function showMoreTourismOffers(begin_offset) { 
if (!btn_lock) { 
    //check if user already visited this page and saw more than 16 boxes 
    if (offset < begin_offset) { 
     offset = begin_offset; 
    } 
    var mobileFlag; 
    if(isMobile == 1){ 
     mobileFlag = true; 
    }else{ 
     mobileFlag = false; 
    } 

    var buttonPosition = $('#show-more-tourism-offers-btn-holder').position(); 
    var buttonPositionTop = buttonPosition.top; 

    $.ajax({ 
     url: base_url + 'pochivki/show_more_offers/', 
     type: 'POST', 
     data: { 
      filter: ajaxDealFilter(true, mobileFlag), 
      country_index: countryIndex, 
      region_index: regionIndex, 
      city_index: cityIndex, 
      offset: offset, 
      current_url: window.location.href 
     }, 
     success: function (data) { 
      $('#tourism-deals-holder').append(data.deals); 
      $('body').scrollTop(buttonPositionTop); 
      if (data.hideButton) { 
       $('#show-more-tourism-offers-btn-holder').remove(); 
      } 
      offset += 48; 
      $('#travel-arrow-spinner').hide(); 
     }, 
     error: function() { 

     }, 
     beforeSend: function() { 
      btn_lock = !btn_lock; // becomes true 
      $('#travel-arrow-spinner').show(); 
     }, 
     complete: function() { 
      btn_lock = !btn_lock; // becomes false again 
      $('.images-rotation').imagesRotation() 
     }, 
     dataType: "json" 
    }); 
} 

}ブラウザのコンソールで

関連する問題