当target属性在XHTML script中无效时

<a href="#" target=_blank></a>target此属性能够使链接在新窗口打开,但是在XHTML script中无效时。


那么解决方案利用js:

<script type="text/javascript"> 
var tmpExample = 
{
    ready:function()
    {
        jQuery('ul#tmpFavorites li a').click
        (
            function($e)
            {
                $e.preventDefault();
                window.open(this.href,'favoriteLink','');
            }
        );
    }
};
jQuery(document).ready(tmpExample.ready);
</script> 

原文地址:https://www.cnblogs.com/lpshan/p/4390766.html