Javascript 在IE浏览器中显示结果
我有这个代码来确定java值。Javascript 在IE浏览器中显示结果,javascript,internet-explorer,Javascript,Internet Explorer,我有这个代码来确定java值。 <!DOCTYPE html> <html> <body> <p id="demo">Click the button to determine whether your browser has Java enabled.</p> <button onclick="myFunction()">click mee </button> <script>
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to determine whether your browser has Java enabled.</p>
<button onclick="myFunction()">click mee </button>
<script>
function myFunction()
{
var x = "Java Enabled: " + navigator.javaEnabled();
document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>
单击该按钮以确定浏览器是否启用了Java
点击mee
函数myFunction()
{
var x=“Java Enabled:”+navigator.javaEnabled();
document.getElementById(“demo”).innerHTML=x;
}
当我单击按钮时,结果将显示在同一浏览器中,但我希望它显示在
IE
浏览器中。如果只想在IE中显示,请使用
您想只在IE中显示吗?我想它会在所有浏览器中显示,但不会在IE中显示。。是这样吗?顺便问一下,你的IE版本是什么?如果我理解你的问题,那么你要求从firefox打开一个IE窗口,是吗?使用navigator.appName检查使用的浏览器。它将是Microsoft Internet Explorer for IE browserHi,单击该按钮以确定浏览器是否启用了Java。
单击Meeee I sthis is write code to display<!--[if IE]>
<script>
function myFunction() {
var x = "Java Enabled: " + navigator.javaEnabled();
document.getElementById("demo").innerHTML=x;
}
</script>
<![endif]-->