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);
}
文章来自天津网站建设,高端网站策划公司天津文率科技http://www.wenshuai.cn/的技术总监韩文博的新浪博客。