How to show a loading gif mean while a submit form is being executed JQuery

前端 未结 5 371
甜味超标
甜味超标 2020-12-16 00:59

I\'m trying to show a simple spinner gif meanwhile a submit is being executed (it takes a bit because I have to establish some communications with providers via web services

5条回答
  •  有刺的猬
    2020-12-16 01:29

    The real issue with your implementation is how does the client side know when your request has completed. One of the reasons why Ajax is helpful is because we have a notion of states and therefore we can display a loader while the client is waiting for a response and remove the loader when the client receives a response.

    How are you going to determine when the communication with the web service is completed? You say that you don't want to use Ajax, but if you are going to want to query a service to determine whether your communication completed, you are probably seeing something that will require Ajax.

提交回复
热议问题