提交图像上的jQuery不起作用.如何修复它



我确实尝试了每个选项,我厌倦了搜索。希望您能为此提供帮助。

下面的代码:

 <?= FORM::button('submit', __('SUBMIT YOUR AD'), array('type'=>'submit','class'=>'btn btn-large btn-primary btn-publish-new','action'=>Route::url('post_new',array('controller'=>'new','action'=>'index'))))?>
                  </div>
                     </div>
            </fieldset>

<img src="//www.linkinads.com/images/loading-blue.gif" style="display: none;" id="loading">
<script>
$("#loading").bind("ajaxSend", function(){
   $(this).show();
 }).bind("ajaxComplete", function(){
   $(this).hide();
 });
</script> 

请让我知道任何解决方案。我没有资源。谢谢

根据我在jQuery上看到的所有文档,ajaxSendajaxComplete事件直接应用于$(document),而不是特定元素,因为这些是全局事件。您可以这样使用:

$(document).bind("ajaxSend", function(){
    $("#loading").show();
});

尽管我不知道真正的解释,但要删除

'data-ajax'=>'false'

解决我的问题。

我希望您可以向我解释有关此解决方案的信息。我希望这还可以。

谢谢

最新更新