[转]使用CSS和JQuery,模拟超链接点击 原文:http://www.cnblogs.com/return8023/archive/2012/05/19/2509177.html

按理论来说 $('#aGo').click();就可以达到效果 那是IE7 才有效果 

Chrome是不行的

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style>
            /*给a标签增加一个属性*/
            a.forward {
            }
        </style>
        <script type="text/javascript" src="jquery-latest.js"></script>
    </head>
    <body>
        <a id="aGo" class="forward" href="showWeibosBatch.php">去微博</a>

        <script type='text/javascript'>
        $(document).ready(function() {
                $('a.forward').click(function() {
                    location.href = $(this)[0].href;
                    return false;
                });
                $('#aGo').click();
            });
        </script>
    </body>
</html>

更多解释可以去原文:

http://www.cnblogs.com/return8023/archive/2012/05/19/2509177.html

posted @ 2013-04-16 18:56  cart55free99  阅读(174)  评论(0编辑  收藏  举报