jsp页面ie跳转谷歌

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
</head>
<body>
<div>
    <a href=" "  onclick='test()'>打开chrome</a>
</div>
</body>
</html>
<script type="text/javascript">
    function test(){
        var objShell = new ActiveXObject("WScript.Shell");
        objShell.Run("cmd.exe /c start chrome http://localhost:8021", 0, true);
    }
</script>

  

posted @ 2022-09-05 14:20  zwbsoft  阅读(248)  评论(0编辑  收藏  举报