jQueryUI button disable causes href to go haywire
So, I have a strange problem and am beginning to think it's a bug in jQueryUI's button class, but I wanted to see if anyone else has seen this before I crack open the source code.
I have a button that is generated from a hyperlink created with a Rails form helper:
<a rel="nofollow" id="executeCriteriaButton" data-method="post"
class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
href="https://localhost:3443/runs?criteria_id=2" role="button">
<span class="ui-button-开发者_运维百科text">Execute</span></a>
So, basically we want to stop the user from double tapping, especially because moving to the next page can take some time. So, I added this:
$("#executeCriteriaButton").click(function(){
$("#executeCriteriaButton").button( "option", "disabled", true );
});
So, what's weird is this... it disables fine, and moves to the new href fine, but it's a GET instead of a POST. This kills the crab.
If you try it with disabled - false it also breaks it.
Any thoughts?
精彩评论