I have (successfully) been using the following on my old Vista machine:
var isIE = isInternetExplorer();
$("#divTablesButton" + (isIE ? "" : " :input"))
.attr( "disabled", this.m_Array1.length === this.m_Array2.length ? true : false );
where divTablesButton
is a button and isInternetExplorer
is the function (which still seems to be working fine):
function isInternetExplorer() {
return ( getInternetExplorerVersion() < 0 ? false : true );
};
function getInternetExplorerVersion() {
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat(RegExp.$1);
}
return rv;
};
But now I have noticed this does not work on my Win 8.1 machine with the newest versions of IE and Chrome.
Anyone know what is up? To clarify, it's the attr("disabled"
bit that is wrong. The buttons do not disable.