English 中文(简体)
变换和递减《古兰经》无侵扰性格?
原标题:Changing and Submitting URL with unobtrusive jQuery?
  • 时间:2010-10-03 22:22:08
  •  标签:
  • jquery
  • ajax

我有一队长,可以 to住用户环境,我要补充一些不言而喻的笑话,这样一页就不必每次重载。 到目前为止,我发现的一切都涉及形式,因为只有少数人权利才能通过 j提交。

我再说一遍,他怎么会屈服。

<a class="user_attrs" href="/users/testuser/attr/img/1" alt="show image"/></a> 

我愿改变网页上的所有用户——攻击者链接,以便他们能够通过Ajax/jquery将 升。

感谢

最佳回答

我认为,你可以这样做:

$( a.user_attrs ).click(function(e) {
    var ev = e || event; 
    $.post($(this).attr( href ), function(data) {
       //do something with data...
    });
    ev.preventDefault();
});
问题回答

也许像这样的东西?

$("a.user_attrs").click(function(evt){
    evt.preventDefault();
    $.post($(this).attr("href"),function(response){
        //Here you can add some feedback
    });
    return false;
});

我总是这样做,对我来说,工作做得很好。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签