檢測(cè)是否是數(shù)組:
ES3檢測(cè)是否是數(shù)組:
Object.prototype.toString.call(要判斷的變量)
ES5檢測(cè)是否是數(shù)組:
Array.isArray()
數(shù)組轉(zhuǎn)字符串:join("分隔符")
字符串轉(zhuǎn)換數(shù)組:split("分隔符")
js對(duì)象轉(zhuǎn)換成js字符串:stringify()
js字符串轉(zhuǎn)換成js對(duì)象:parse()
函數(shù)表達(dá)式與函數(shù)聲明
if (window.location.toString().indexOf('pref=padindex') != -1) {
} else {
if (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || /\(Android.*Mobile.+\).+Gecko.+Firefox/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
if (window.location.href.indexOf("?mobile")<0){
try {
if (/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
window.location.;
} else if (/iPad/i.test(navigator.userAgent)) {
//window.location.
} else {
window.location.
}
} catch (e) {}
}
}
}