- 论坛徽章:
- 0
|
<script language="javascript"> function checkBrowser(notWhich){ var ua = navigator.userAgent; var filter = ".*?"+notWhich+"*"; var filter = new RegExp(filter,'i'); if(filter.test(ua)){ alert("We are sorry ,we have detected that your browser is "+ notWhich+" Our webservice is not support to " +
notWhich +",as we will create a SVG ,and "+ notWhich +" does not parse this format,so we recommand you use other
browser like Firefox or Chrome, or you can download the SVG file and view it with tools like Inkscape."); } } checkBrowser('MSIE'); </script>
注意的就是regex如果需要通过变量来构造,需要使用RegExp,然后就是串连接需要用+,而不是著名的. "Hello" + " World"
|
|