蚂蚁's profile阳光森林PhotosBlogListsMore Tools Help

Blog


    June, 2009

    <a href=””>的一个小技巧

    使用javascript的时候,通常我们会通过类似:
    <a href="#" onclick="javascript:方法">提交</a>
    的方式,通过一个伪链接来调用javascript方法.这种方法有一个问题是:
    虽然点击该链接的时候不会跳转页面.但是滚动条会往上滚,解决的办法是返回一个false.
    如下所示:
    <a href="#" onclick="javascript:方法;return false;">提交</a>

     

    还可以用 ### or #this #加一个或多个字符

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://antsdong.spaces.live.com/blog/cns!CF43121027CEF87E!333.trak
    Weblogs that reference this entry
    • None