1.、先在当前页面进行操作
tableData.ChangeA = function (rowData) {
window.location.href="/adDdeptCode=" + rowData.deptId + '&month=' + rowData.month; //window.location.href跳转新页面
};
2、在另一个页面对链接进行解析
function parseUrl(url){
var query = url.split("")[1];
var queryArr = query.split("&");
var obj = {};
queryArr.forEach(function(item){
var key = item.split("=")[0];
var value = item.split("=")[1];
obj[key] = decodeURIComponent(value);
});
return obj;
}
// url传递的信息
var urlMsg = parseUrl(window.location.search);
3、对参数进行解析:
$.ajax({
url:'/attend/getByDeptdeptCode='+urlMsg.deptCode+'&month='+urlMsg.month,
method: 'get'
})
.done(function (msg) {
})