我想检测用户是否使用IE和Firefox,但我找不到脚本.
我的代码如下:
$(document).ready(function(e) {
$.browser.chrome = /chrom(e|ium)/.test(navigator.userAgent.toLowerCase());
if($.browser.chrome){
alert(1);
//this work well
}
else if(//the browser is IE){alert(2);}
else if(//the browser is Firefox){alert(3);}
//The problem is that I don't know how to write a script for IE and FireFox browser for chrome is work fine
)};
Run Code Online (Sandbox Code Playgroud) I have the PHP code as below:
<?php
echo "<tr></tr>";
//ouput I want : <tr></tr>
?>
Run Code Online (Sandbox Code Playgroud)
当输出我想要显示<tr></tr>.但我不知道我应该使用的whitch功能,任何人都知道请帮帮我,谢谢