Per il rilevamento MSIE è possibile utilizzare JavaScript:
// This function returns Internet Explorer's major version number,
// or 0 for others. It works by finding the "MSIE " string and
// extracting the version number following the space, up to the decimal
// point, ignoring the minor version number
<SCRIPT LANGUAGE="JavaSCRIPT">
function msieversion()
{
var ua = window.navigator.userAgent
var msie = ua.indexOf ("MSIE ")
if (msie > 0) // If Internet Explorer, return version number
return parseInt (ua.substring (msie+5, ua.indexOf (".", msie)))
else // If another browser, return 0
return 0
}
</SCRIPT>
Di seguito è un esempio di come chiamare ovunque nel tuo html:
<SCRIPT LANGUAGE="javascript">
if (msieversion() >= 0)
document.write ("This is Internet Explorer");
else
document.write ("This is another browser");
</SCRIPT>
http://support.microsoft.com/kb/167820 http://support.microsoft.com/kb/167820
fonte
2013-04-06 05:14:24
Mi piace la semplicità di questa risposta. Qualcuno ha obiezioni a questo, perché anche se le altre risposte sono più complete (numero di versione della copertina, ecc.) Tutto ciò di cui ho bisogno è il tipo di browser. Ma tutti i problemi noti qui. A proposito, l'ho provato su FF e ha detto Netscape! – Duber
L'ho provato su Chrome e dice anche netscape: s –
Chrome, Firefox e Safari restituiscono il nome "Netscape". –