<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container-fluid">
<div class="row justify-content-center">
<button name="exportToExcel" id="exportToExcel" type="button" class="btn btn-primary btn-lg btn-block" onClick="window.open('https://intelshare.intelink.gov/sites/n-nc-capes-mgt/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={877D280F-57CA-47F9-8F9E-EC862AC03018}&View={6DB15A6E-E5A3-45BA-AE8F-705A44BB0932}&CacheControl=1&RootFolder=')">Export Draft RMG Tracker List to Excel</button>
</div>
</div>
button:disabled {
background: #dddddd;
}
$(document).ready(function()
{
/* Get browser */
if ($.browser.webkit)
{
// is Google Chrome
alert('Your Browser is Chrome');
$('#exportToExcel').prop(' disabled ', true); //TO DISABLE
$('#exportToExcel').attr(' disabled ', true); //TO DISABLE
$('#exportToExcel').attr(' aria-disabled ', true) //TO DISABLE
$('#exportToExcel').addClass(' disabled '); //TO DISABLE
/* Finally, if it is Chrome then jQuery thinks it's
Safari so we have to tell it isn't */
$.browser.safari = false;
$.browser.mozilla = false;
}
/* Detect Safari */
if ($.browser.safari)
{
alert('Your Browser is Safari');
}
/* Detect Firefox*/
if ($.browser.mozilla)
{
alert('Your Browser is Firefox');
/* Do something for Safari */
$('#exportToExcel').is('disabled', true); //TO ENABLE
$('#exportToExcel').removeattr(" disabled "); //TO ENABLE
$('#exportToExcel').removeClass('disabled'); //TO ENABLE
$.browser.safari = false;
$.browser.webkit = false;
}
// If the browser type is Opera
if ($.browser.opera)
{
alert('Your Browser is Opera');
}
// If the web browser type is Internet Explorer
if ($.browser.msie)
{
alert('Your Browser is MSIE');
$('#exportToExcel').is('disabled', false); //TO ENABLE
$('#exportToExcel').removeattr("disabled"); //TO ENABLE
$('#exportToExcel').removeClass('disabled'); //TO ENABLE
}
});
});