// cookie设置
function setCookie(key, val, seconds) {
    var date = new Date();
    date.setTime(date.getTime() + seconds * 1000);//只能这么写，10表示10秒钟
    console.log(key)
    console.log(val)
    $.cookie(key, val, {expires: date});
}
//获取url参数
function GetUrlParam(paraName) {
    let url = document.location.toString();
    let arrObj = url.split("?");
    if (arrObj.length > 1) {
        var arrPara = arrObj[1].split("&");
        var arr;
        for (var i = 0; i < arrPara.length; i++) {
            arr = arrPara[i].split("=");

            if (arr != null && arr[0] == paraName) {
                return arr[1];
            }
        }
        return "";
    }
    else {
        return "";
    }
}

// 捕捉全局异常弹出
function handleError(msg,url,l)
{
    var txt="There was an error on this page.\n\n"
    txt+="Error: " + msg + "\n"
    txt+="URL: " + url + "\n"
    txt+="Line: " + l + "\n\n"
    txt+="Click OK to continue.\n\n"
    alert(txt)
    return true
}
window.onerror = handleError
