js在IE中不能直接调用java吗?下面代码我把!=改成==后错误,什么原因啊..
if(navigator.javaEnabled() && (navigator.appName != 'Microsoft Internet Explorer '))
{
seventeenth = java.awt.Toolkit.getDefaultToolkit();
first2 = java.net.InetAddress.getLocalHost();
second2 = first2.getHostName();
fifth2 = first2.getHostAddress();
alert( "Your host name is ' " + second2 + " '\nYour IP address is " + fifth2);
}
大意是不是显示主机名和ip,在IE下应该怎么弄啊...
------解决方案--------------------js在IE中不能直接调用java,要获取主机名和ip最好在java代码中实现。
------解决方案--------------------if(navigator.javaEnabled() && (navigator.appName != 'Microsoft Internet Explorer '))
{
<%
seventeenth = java.awt.Toolkit.getDefaultToolkit();
first2 = java.net.InetAddress.getLocalHost();
second2 = first2.getHostName();
fifth2 = first2.getHostAddress();
%>
alert( "Your host name is ' " + <%=second2%> + " '\nYour IP address is " + <%=fifth2%> );
}