iframe没有加载来自ajax响应的内容

时间:2014-02-05 07:08:55

标签: jquery ajax iframe fancybox

在加载作为AJAX iframe响应收到的内容时,我遇到GET问题。让我详细解释一下我的问题:

Ajax请求处理得很好并且获得响应数据非常好,但是当我在fancybox中的iframe中加载内容时,我在浏览器中得到以下问题。

The requested URL /new/<div id="wrapper"><div id="header"><div class="top_gradient"></div> <div class="topInfo-inner floatLeft"> <div class="topTitleSmall floatLeft" id="packetdeals"> <input type="button" name="snelzoeken" id="button" class="btn btn-success" value="Packet Deals" /> </div> <div class="topTitleSmall" id="exchangeRates"><div class="floatLeft"> <input type="button" name="snelzoeken" id="button" class="btn btn-success" value="Room Types" /> </div> </div> <div class="language"> <ul class="language-flags"> <li><img hspace="3" border="0" title="Nederlands" alt="Nederland" src="img/flag_nl_small.png"></li> <li><img hspace="3" border="0" title="Dutch" alt="Dutch" src="img/flag_du_small.png"></li> <li><img hspace="3" border="0" title="English" alt="English" src="img/flag_en_small.png"></li> <li><img hspace="3" border="0" title="French" alt="French" src="img/flag_fr_small.png"></li> </ul> </div> </div> <div class="floatLeft" id="dateSelection"> <div class="search-wrapper"> <div class="search"> <ul> <li> <div> <a href=" was not found on this server.

以下是我用于请求并在iframe fancybox中获取响应的代码。

$.fancybox.showLoading();

$.ajax({
  type: "POST",
  cache: false,
  async:false,
 url: url, // preview.php
  data: $('#'+frmname).serializeArray(), // all form fields
  success: function (data, textStatus, request) {

    // on success, post (preview) returned data in fancybox
    $.fancybox(data, {
      // fancybox API options
      fitToView: false,
     type:'iframe',
      autoSize: false,
      closeClick: false,
      openEffect: 'none',
      closeEffect: 'none'
    }); // fancybox
  } // success
});

0 个答案:

没有答案