jQuery的AJAX空白頁的問題這在Firefox和Chrome,但在IE失敗。它確實在警報中顯示結果,但該頁面在IE中僅爲空白。我沒有得到任何類型的Firebug錯誤,所以我無法確定這個問題。任何人都可以在我的最後發現任何明顯的錯誤...或知道解決方法嗎?與IE9
謝謝。
$("#compareit").submit(function(e){
$("#topsection").hide();
$("#tabs").hide();
$("#bottomWrap").hide();
$("#error").html('');
$("#leftcolumn").hide();
$("#rightcolumn").hide();
e.preventDefault();
var queryString = $('#compareit').serialize();
var dataString = queryString + "&count=" + totalselected;
$.ajax({
type: 'GET',
url:'newmlbcompare2.php',
cache: false,
data: dataString,
success:function(result){
$('#ajaxDiv').html(result);
// This alerts the HTML block that is being returned (in all browsers)
//alert(result);
}
});
return false;
});
根據要求添加了HTML。我已經被截斷了一些節省空間:
<div id="maincontainer">
<div id="topsection"><div id="topImage"></div></div>
<div id="contentwrapper">
<div id="contentcolumn">
<div class="innertube">
<div id="compareWrapper">
<form name="compareit" id="compareit" action="">
<input type="hidden" value="2011" name="year" id="year" />
<div id="tabs">
<ul>
<li><a href="#tabs0">C</a></li>
<li><a href="#tabs1">1B</a></li>
</ul>
<div id="tabs0">
<select multiple id="C" name="playArray[]" class="tabStyle" size="10">
</select>
</div>
<div id="tabs1">
<select multiple id="FB" name="playArray[]" class="tabStyle" size="10">
</select>
</div>
</div>
<div id="bottomWrap">
<div id="instructions"><b>Players:</b> Select up to four players.</div>
<div id="added_players" align="center" class="added_players"></div>
<div id="error" class="err"></div>
</div>
</div>
<div id='start'></div>
</form>
<div id="ajaxDiv"></div>
</div>
</div>
<div id="leftcolumn">
<div class="innertube">
<div id="accordionLeft">
</div>
</div>
</div>
<div id="rightcolumn">
<div class="innertube">
<div id="accordionRight">
</div>
</div>
</div>
哪裏是關聯和相關的HTML代碼?任何人都可以重現你的問題? http://sscce.org/ – Sparky 2012-04-02 16:26:58
還請提供php腳本'newmlbcompare2.php',以便我們可以看到您嘗試插入到您的#ajaxDiv中的HTML。 – Stefan 2012-04-02 17:34:44
@Stefan。我試圖插入表格數據 – relyt 2012-04-02 17:53:01