0
我有以下的javascript,從而重新加載一個PHP網站變成一個div:於JavaScript傳遞多個參數,使用PHP變量
if (boxes.length) {
$(".loadingItems").fadeIn(300);
// Change the name here as well
$(".indexMain").load('indexMain.php?'+this.name+'=' + boxes.join("+"),
function() {
$(".indexMain").fadeIn('slow');
$(".loadingItems").fadeOut(300);
});
我想通過另一個參數在同一網址...
所以我想我應該這樣做,如下所示,但我無法得到它的工作。這是正確的方式嗎?
我試圖用一個PHP變量$category
這樣傳遞參數categ
:
if (boxes.length) {
$(".loadingItems").fadeIn(300);
// Change the name here as well
$(".indexMain").load('indexMain.php?categ=<?php echo $category;?>&'+this.name+'=' + boxes.join("+"),
function() {
$(".indexMain").fadeIn('slow');
$(".loadingItems").fadeOut(300);
});
看起來沒問題。你能顯示渲染輸出嗎? – Popnoodles