我想举办一个活动,直到我准备开火,例如
$('.button').live('click', function(e){
e.preventDefault();
// do lots of stuff
e.run() //this proceeds with the normal event
}
Run Code Online (Sandbox Code Playgroud)
是否有与上述run()功能相同的功能?
我有一个基于 Spring Web 模型-视图-控制器 (MVC) 框架的项目。Spring Web 模型-视图-控制器 (MVC) 框架的版本是 3.2.8。我想更改提交按钮上的表单操作。所以这是我的代码,但根本没有改变任何东西!
<script type="text/javascript">
$('#awardProductsButton').click(function(){
$('#devicesFormId').attr('action', 'test');
});
</script>
<form:form commandName="devicesForm" name="devicesForm" id="devicesFormId" method="post"
action="${contextPath}/newdesign/manage/devices/${devicesForm.devices.id" htmlEscape="yes" enctype="multipart/form-data">
<button id="awardProductsButton" class="btn btn-primary" type="submit">AWARD product/s</button>
</form:form>
Run Code Online (Sandbox Code Playgroud)
我也尝试过
$('#awardProductsButtonId').submit(function(event){
alert ('test');
event.preventDefault();
$('#deviceFormId').attr('action', '${contextPath}/newdesign/manage/device/${deviceForm.device.id}');
});
Run Code Online (Sandbox Code Playgroud)
但即使警报也没有出现