0
我有一個儀表板頁面,用戶可以輸入資產代碼或ID進行搜索,點擊搜索按鈕或點擊輸入搜索結果以Facebox模式顯示。到現在爲止還挺好。但是,當用戶嘗試執行第二次搜索時,儘管JQuery POST正確發生,並且響應HTML按原樣返回,但Facebox結果模式無法打開。結合到提交功能,並執行AJAX POST我的功能如下:Facebox只在第一個jQuery表單提交時打開一次 - 任何幫助?
// attach a submit handler to the form
$("#astsrch").submit(function(event) {
//$('a[rel*=facebox]').facebox();
// stop form from submitting normally
event.preventDefault();
// get some values from elements on the page:
var $form = $(this),
term = $form.find('input[name="assetsearch"]').val(),
url = $form.attr('action');
// Send the data using post and put the results in a div
$.post(url, { assetsearch: term } ,
function(data) {
$.facebox(data);
}
);
});
看來,當點擊Facebox關閉按鈕時阻止任何進一步Facebox從開放搜索表單提交時有事情發生通過上述功能。如果有人能夠解決這個問題,我將非常感激。
感謝您花時間閱讀我的問題。