{"id":251,"date":"2009-10-12T17:11:02","date_gmt":"2009-10-12T11:41:02","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=251"},"modified":"2016-08-24T15:45:45","modified_gmt":"2016-08-24T10:15:45","slug":"ajax-request-progress-indicator","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/ajax-request-progress-indicator\/","title":{"rendered":"Ajax Request Progress Indicator"},"content":{"rendered":"<p>In my current project, I used ajax to fetch data from the server to <a title=\"user experience design services\" href=\"http:\/\/www.tothenew.com\/experience-design\">provide experience like Desktop Application<\/a>. I wanted to automatically show an indicator when an AJAX request is ongoing, and hide it when there is no such request. So I found the following solution for both the Prototype library and the JQuery library.<\/p>\n<p>Make sure the following HTML is included on every page where AJAX requests are made. (Place it in body of the main layout so that you do not have to repeat this HTML on each page.<\/p>\n<p>Make sure the following javascript code has been executed before any AJAX request is made. (Move this to a js file and include it in Heading part of the main layout).<\/p>\n<p>The above trick worked for me and hope it works for you guys too.<\/p>\n<p>Helpful links :-<br \/>\nhttp:\/\/www.prototypejs.org\/api\/ajax\/responders<br \/>\nhttp:\/\/docs.jquery.com\/Ajax\/jQuery.ajax<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my current project, I used ajax to fetch data from the server to provide experience like Desktop Application. I wanted to automatically show an indicator when an AJAX request is ongoing, and hide it when there is no such request. So I found the following solution for both the Prototype library and the JQuery [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0},"categories":[1],"tags":[96,1178,55,27,138],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/251"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}