2016-12-17 55 views
0

我遇到了Fancybox(v2.1.5)的問題。我想在生成PDF導出打開「等等,請」對話框:Fancybox返回「無法加載請求的內容」。在Firefox

function ShowLoading(token, message) { 
     $.fancybox({ 
      'href': 'path/to/MVC/controller', 
      'type': 'ajax', 
      'hideOnOverlayClick': false, 
      'showCloseButton': false, 
      'modal': true, 
      'enableEscapeButton': false, 
      'closeClick': false, 
      'beforeShow': function() { 
       $(".popup-loading-message").text(message); 
      }, 
      helpers: 
       { 
        overlay: { closeClick: false } 
       } 
     }); 
.... 
} 

HREF點MVC控制器方法,返回什麼比這更:

<div class="popup-loading"> 
    <div class="popup-loading-content"> 
     <div class="popup-loading-graphics"><i class="fa fa-refresh fa-spin fa-fw"></i></div> 
     <div class="popup-loading-message"></div> 
    </div> 
</div> 

所有工作完全在Chrome或IE瀏覽器,但不是在Firefox中,我得到「所請求的內容無法加載」。錯誤信息。有任何想法嗎? 謝謝。

回答

0

問題解決了,這是招:

function ShowLoading(token, message) { 
    setTimeout(function() { 
     $.fancybox({ 
      'href': 'path/to/MVC/controller', 
      'type': 'ajax', 
      'hideOnOverlayClick': false, 
      'showCloseButton': false, 
      'modal': true, 
      'enableEscapeButton': false, 
      'closeClick': false, 
      'beforeShow': function() { 
       $(".popup-loading-message").text(message); 
      }, 
      helpers: 
       { 
        overlay: { closeClick: false } 
       } 
     }); 
    .... 
    }); 
} 

不要問爲什麼... O)

相關問題