1
在組合框中所示,我發佈一個參數jQuery中使用AJAX與下面的腳本的網址:我怎樣才能從以前的帖子參數數據,未在URL
$('#plant').change(function(e2){
$('#location').html('<img src="02_files/01_images/loading.gif">');
var plant = $(this).val();
$.ajax({
type: "POST",
url: "03_themepage/sfer/otherforms/z161_combobox_action.php",
data: "plant="+plant,
success: function(data){
$('#location').html(data);
}
});
});
當我運行該腳本在從該組合框中選擇了該選項後,在url中,參數'plant'未被顯示。其實網址沒有改變。
同時,我需要來自第一個組合框的數據(根據所選),以包含在下一個組合框中。
$('#location').change(function(e3){
$('#maingroup').html('<img src="02_files/01_images/loading.gif">');
var location = $(this).val();
$.ajax({
type: "POST",
url: "03_themepage/sfer/otherforms/z161_combobox_action.php",
data: "plant="+plant+"&location="+location, //plant data taken from previous url post
success: function(data){
$('#maingroup').html(data);
}
});
});
這兩個數據都是最後一個組合框所必需的。
我的問題是,如何從第一個組合框中獲取參數數據以包含在第二個組合框中,因爲它沒有顯示在url中?