Use these when you want to detect the browser type using javascript:
// IE browser
var ie = document.all != null; //ie4 and above
var ie5 = document.getElementById && document.all;
var ie6 = document.getElementById && document.all&&(navigator.appVersion.indexOf("MSIE 6.")>=0);
// Netscape browser
var ns4 = document.layers != null;
var ns6 = document.getElementById && !document.all;
var ns = ns4 || ns6;
// Firefox browser
var ff = !document.layers && !document.all;
// Opera browser
var op = navigator.userAgent.indexOf("opera")>0;
var op7 = op && operaVersion() <= 7;
var op8 = op && operaVersion() >= 8;
Posted 1 month ago #
For opera detection you can also figure out the version:
function operaVer() {
agent = navigator.userAgent;
idx = agent.indexOf("opera");
if (idx>-1) {
return parseInt(agent.subString(idx+6,idx+7));
}
}
Posted 1 month ago #
You must log in to post.
.net address attributes browsers censored config css dates email validation filter firefox floor functions html ie ie fix image functions images input ip javascript links mail match math min-height min-width netscape opera php preloading print regex script smtp string styles textbox time validation variables visual basic