var TERM_CODE = "00490001";
if ((/ipod/gi).test(navigator.userAgent)) {
TERM_CODE = "00490004";
} else if ((/ipad/gi).test(navigator.userAgent)) {
TERM_CODE = "00490003";
} else if ((/iphone/gi).test(navigator.userAgent)) {
TERM_CODE = "00490001";
} else if ((/Android/gi).test(navigator.userAgent)) {
TERM_CODE = "00490002";
} else {
TERM_CODE = "00490005";
click = "click", _down = "mousedown", _move = "mousemove", _up = "mouseup";
};
// APP_ID = 2 固定
// TERM_CODE
// 手持終端類型 00490001 IPHONE
// 手持終端類型 00490002 ANDROID
// 手持終端類型 00490003 IPAD
// 手持終端類型 00490004 IPOD
// 手持終端類型 00490005 PC
// 手持終端類型 00490006 OTHER
// USER_ID = accountId
// DEVICE_ID = openId
// IMIS = openId
// FUNCID = 微信3.0接口對應FuncId.xlsx 文檔
// UID = 權限接口的uid
if ((/MSIE/gi).test(navigator.appVersion)) {
document.querySelector("body").style.display = "none";
setTimeout(function(){
alert("不支持該瀏覽器");
}, 100);
}
轉碼
function fileSelected() {
var oFile = document.getElementByIdx_x_x('image_file').files[0];
var rFilter = /^(image\/bmp|image\/gif|image\/jpeg|image\/png|image\/tiff)$/i;
if (! rFilter.test(oFile.type)) {
return;
}
var oReader = new FileReader();
oReader.onload = function(e){
document.getElementByIdx_x_x('pic').value=e.target.result;
};
oReader.readAsDataURL(oFile);
}