我正在使用jQuery和$(document).ready事件當我在IE8中加載時出現錯誤「對象不支持此屬性或方法」。當我刷新它工作正常,這是我的代碼:
<script language="text/javascript">
$(document).ready(function()
{
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("loginbox").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","loginform.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send();
});
</script>
我有我的頭標記以下內容:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js">
任何幫助,將不勝感激我曾嘗試$(窗口).load和其他
你確實是意識到jQuery的可以通過'$。員額發送AJAX請求()','$獲得()'和'$。阿賈克斯()'的功能呢? – Blender 2011-06-04 03:58:00
是的,我正在努力磨練代碼,最終,這與文件服務器交互。 – Clay 2011-06-04 04:00:14