dojo.isIE / has(“ie”)
dojo.isMozilla / has(“mozilla”)
dojo.isFF / has(“ff”)
dojo.isOpera / has(“opera”)
dojo.isSafari / has(“safari”)
dojo.isKhtml / has(“khtml”)
dojo.isAIR / has(“air”) - true if running within the Adobe AIR environment
dojo.isQuirks / has(“quirks”) - is the browser in Quirks-Mode
dojo.isBrowser / has(“host-browser”) (not typically needed when only targeting browsers)
dojo.isWebKit / has(“webkit”) (1.3+)
dojo.isChrome / has(“chrome”) (1.3+)
dojo.os.win返回true说明操作系统是Windows
dojo.os.linux返回true说明操作系统是Linux
dojo.os.osx返回true说明操作系统是MacOS
附上dojo API http://dojotoolkit.org/api/1.3/dojo/
可以这样判断window是xp还是win7
var n = navigator;
var dua = n.userAgent;
if(dua.indexOf("Windows NT 6.1") > 0 ) { //win7
}
else if(dua.indexOf("Windows NT 5.1") > 0) {//xp
}
判断浏览器是IE7
navigator.appVersion.indexOf("IE 7.0")
原文链接:https://www.f2er.com/dojo/291576.html