javascript - Removing an Ajax loader image after sometime -


I have an AJAX loader that appears after clicking a button with the following code:

  JQuery (document) .ready (function ($) {{$ .getElementById ('form') .Onsubmit = function () {$ .getElementById ('submit'). Style.display = 'block '; $ .getElementById (' Loading2 '). Style.display =' block ';};} (document)); });  

HTML:

  & lt; Input type = "submit" class = "button alt" onclick = "$ (\ '# loading)'. Show ();" Name = "woocommerce_checkout_place_order" /> ' 

I have to leave the AJAX loader after 10 seconds.

Please tell me

You can use it to hide your loader after 10 seconds can do.

  setTimeout (function () {$ ('# loading'). (); // I was not sure that you wanted to hide $ ('# loading2'). Hide () ;}, 10000);  

It is also not sure if it is looking at your code, if it will work anyway. Apart from this, if you are using jQuery, you do not really need to use vanilla javascript, so that your code can be changed on this. $ ('Display', 'block'); $ ('# loading2'). CSS ('display', ' Block '); Submit (function () {$ (' # submit ').});});


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -