[英]Jquery Ajax in Ie runs only once
我的代碼我已將cache:false設置為仍在IE中運行一次。 請幫我。
<script type="text/javascript" src="javascripts/jq1.7.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#butn").click(function(){
var txt1 = $("#txt1").val();
$.ajax({
type: "Post",
url: "jqueryphp.php",
dataType: "html",
data: "txt1="+txt1,
cache: false,
success: function(result) {
$("div").html(result);
}
});
});
});
</script>
</head>
<body>
<form>
<input type="text" id="txt1" /><br />
<input type="button" id="butn">
</form>
請幫助我,我被困在這里。 它可以在除IE之外的所有瀏覽器上正常運行
嘗試類似的方法:
$.ajaxSetup({
cache: "false"
});
$.ajax({
type: "POST",
url: "jqueryphp.php",
data: "txt1="+txt1,
cache: false,
success: function(result){
$("div").html(result);
}
});
希望能幫助到你
IE瀏覽器是貪婪的。 考慮為每個URL添加一個時間戳。 這里還有其他一些選擇。 http://formatinternet.wordpress.com/2010/01/14/ie-cache-for-ajax-requests/
確保進行調用的文件具有正確的doctype和xmlns聲明。
為調用中涉及的元素分配xmlns ID
例:
還可以使用:jQuery.post('call.php',{action:“ get”}
在此處找到完整的教程: http : //vavumi.com/?p=257
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.