これを確認してください、私はブラウザ&を識別するために、単純なJavaスクリプトを使用しているそのversion.Aのポップアップメッセージが表示され、適切なメッセージが表示されます。以下は ahead-進んでから、ユーザは、単純なHTMLページです: -
<!DOCTYPE html>
<html>
<head>
<style>
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body onload="IEValidationMessage();">
<!-- this is the DIV used for showing message box -->
<div id="myModal" class="modal">
<div id="closeBtn" class="modal-content">
<span class="close">×</span>
<div id="divMessagebody"></div>
</div>
</div>
<script>
// When the user clicks on <span> (x), close the modal
var modal = document.getElementById('myModal');
var span = document.getElementById("closeBtn");
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
function IEValidationMessage() {
modal.style.display = "block";
if (document.documentMode < 9) {
document.getElementById("divMessagebody").innerHTML = "Please Use IE 9 or Above.)";
}
else {
document.getElementById("divMessagebody").innerHTML = "congrats Site is compatible in this IE version ";
}
if (document.documentMode ==undefined) {
document.getElementById("divMessagebody").innerHTML = "Please use IE9 or higher only. ";
}
}
</script>
</body>
+「GTEすなわち9」および/またはそれがさえないように、条件付きのコメントを「IEません」でアプリケーションJSが含まダウンロードする必要があります。 – pawel
thatsは実際に良いpreetey、他のブラウザbtwのためのこのようなソリューションはありますか? IEは私の主な問題ですが、具体的にはIE Xを言っていない状態を作る方法はありますか? –
Internet Explorer 10以降では、条件付きコメントは標準モードでサポートされなくなりました。機能検出機能を使用して、標準モードの詳細については、「ドキュメントの互換性の定義」を参照してください。しかし、バージョン9までIEのための問題なしでそれを使用することができます。 –