我有一個包含作業詳細信息列表的表格,並且每個作業都帶有複選框,當我點擊 下一頁鏈接並選中複選框時,我應該使用複選框值和鏈接來獲取查詢字符串URL查詢字符串使用jquery將數組追加到查詢字符串
<input type="checkbox" class="checkJobToSend" name="checkJOb" value="<TMPL_VAR NAME=job_id>"
<input type="checkbox" class="checkJobToSend" name="checkJOb" value="<TMPL_VAR NAME=job_id>"
<input type="checkbox" class="checkJobToSend" name="checkJOb" value="<TMPL_VAR NAME=job_id>"
<input type="checkbox" class="checkJobToSend" name="checkJOb" value="<TMPL_VAR NAME=job_id>"
<input type="checkbox" class="checkJobToSend" name="checkJOb" value="<TMPL_VAR NAME=job_id>"
<a href ='index.cgi?reqpage=$prev_page&job_category_id=$jobCategory' class='paginateAdmin' id='govtPaginate'>prevPage</a>
function getJobsChecked(){
var arr = [];
var i= 0;
$('.checkJobToSend:checked').each(function(){
arr[i++] = $(this).val();
});
return arr;
}
$(document).ready(function() {
$(document).on('click','.paginateAdmin',
function(e){
e.preventDefault();
var arr = getJobsChecked();
var post = $(this).attr("href");
var array = post.split('?');
var id=$(this).attr('id');
$.post(
'job.cgi',
array[1],
function(data,status){
switch(id)
{
case "nonItPaginate":
$('#nonit').html(data);
break;
case "ItPaginate":
$('#it').html(data);
break;
case "govtPaginate":
$('#govt').html(data);
break;
default:
}
}
);
});
});
我怎樣才能形成具有陣列將queryString [1],並與檢查框值的像
reqpage=2&job_category_id=2&checkJob=1&checkJob=2&checkJob=3