JS实现页面上链接新窗口打开

<script language="javascript">

    $(document).ready(function() {
        $("a").each(function() {

            if (($(this).attr("href")).indexOf("javascript") < 0 && ($(this).attr("href")).indexOf("#") < 0) {

                $(this).attr("target", "_blank");
            }
        })
    });
</script>
原文地址:https://www.cnblogs.com/xyzhuzhou/p/2850847.html