0
我在搜索字段中遇到此問題。當我點擊輸入按鈕時,搜索會被觸發,但只能在Chrome中正常使用。如果我在IE中點擊輸入按鈕,頁面中唯一的變化,如果我點擊按鈕,第二次搜索......的作品。搜索在IE中不起作用。只適用於Chrome
$(document).ready(function(event) {
$("#searchField").keypress(function(event) {
if (event.which == 13) {
search_value = $('#searchField').val();
proj_id = $('#projectId').val();
//alert (search_value + '-' + proj_id);
searchMeeting(search_value, proj_id);
}
});
});
function searchMeeting(search_value, proj_id) {
var lastSearchValue = $('#searchField').val();
if (proj_id != "") {
$.ajaxSettings.traditional = true;
$.ajax({
url : '../meeting/searchMeeting.action',
type : 'post', // method
dataType : 'html',
data : { // data to send
"searchValue" : search_value,
"projectId" : proj_id
},
error : function() { // fail
alert('Failed to search!');
},
success : function(html) {// success
$('#backToList').attr("style","display: none;");
$("#meeting_content").html(html);
$("#searchField").val(lastSearchValue);
bindTableEvents();
}
});
}
}
您是否使用輸入類型「搜索」? –
哪個IE?他們不都支持搜索很好 – Martijn
此外,是否觸發了ajaxcall? – Martijn