我有兩個文件filter.php和products.php包含在index.php中,我正在使用.post提交表單而不刷新。我將數據發送到products.php並將其返還,同時我刷新了過濾器,這是我的問題。當我嘗試變種轉儲後數據filter.php是空如何使用ajax獲取帖子值.post
這裏是我的腳本
function ajaxFilter()
{
var str = jQuery("form[name=\"filters\"]").serialize();
jQuery.post("/", str)
.done(function(data) {
var productList = jQuery(data).find(".list_product").html();
var filter = jQuery(data).find(".filters").html();
jQuery(".list_product").html(productList);
jQuery(".filters").html(filter);
});
}
任何想法如何讓POST?
不過,我覺得這會讓我的文章通過腳本來隱藏輸入,也回報他們以HTML
如果是壞主意或絕對錯誤的開始。
@ICanHasCheezburger? – Neel
@Neel o_O?..... –