// 获取页面中的地址,对字段进行处理
//例如:http://localhost/video_learning/mobile/selectCourse/detail.html?courseId=1131417761608630272&&selectCourseflag=0&&creditHour=2转为courseId=1131417761608630272&&selectCourseflag=0&&creditHour=2
function getlocationAddressByte() {
var url = window.location.search;
return url.substring(url.lastIndexOf('?')+1,url.length);
};
// 获取页面中的地址,对字段进行处理
// 例如: url?selectCourseflag=0&&creditHour=2转为"selectCourseflag=0&&creditHour=2",creditHour:2
//{courseId: "1131417761608630272", selectCourseflag: "0", creditHour: "2"}
function getlocationAddressByte() {
var url = window.location.search;
var localtion = url.substring(url.lastIndexOf('?')+1,url.length);
var tempObj = {};
var arr = localtion.split('&&');
for (var i = 0; i < arr.length; i++) {
var tempTypeArray = arr[i].split('=');
if (tempObj[tempTypeArray[0]]) {
tempObj[tempTypeArray[0]] += ',' + tempTypeArray[1];
} else {
tempObj[tempTypeArray[0]] = tempTypeArray[1];
}
}
// console.log(tempObj);
};
//把对象转换成数组对象, 参数对象, 返回值数组对象
function objToArr(obj) {
var arr = [];
for (let i in obj) {
let o = {};
o[i] = obj[i];
arr.push(o);
}
return arr;
};