我已經構建了一些輸入來讓用戶搜索數據庫。搜索正在使用ajax請求。
我的問題是因爲當我從服務器獲得響應時,我也會得到搜索輸入。我不想那樣。
看看我的代碼:
<script>
$(document).on('change', '.auto-select', function(e){
e.preventDefault();
var tags = $('#auto-tag-script').serialize();
var contracts = $('#auto-contract-script').serialize();
var educations = $('#auto-education-script').serialize();
var towns = $('#auto-town-script').serialize();
runAjax(tags, contracts, educations, towns);
});
function runAjax(tags, contracts, educations, towns) {
$.ajax({
url: 'http://localhost/jobs/public/anazitisi-ergasias?' + tags + '&' + contracts + '&' + educations + '&' + towns
}).done(function(data){
$('div.show-html-from-ajax').html(data);
});
}
</script>
使用上面的代碼,輸入將再次出現在我的頁面中。
有什麼辦法可以逃脫這種形式的輸入。
粘貼你的HTML給我們:) – Buzinas
沒有你的服務器端腳本輸出你不想使用的任何東西。 –