April 15, 2012

Ajax loader div in zend framework

Question by KJA

through my application I use common Ajax loader Div, i show it always when i make an ajax request

submitHandler: function(form) { 

                $('#loader').show();
                $(form).ajaxSubmit({
                    type: 'POST',
                    url: "/exampleactions/example",
                    data:{
                    },
                    success: function(response_data){
                        $('#loader').hide();

where is the best place to put this div to use it every where ?

shall i put it layout.php ?

Answer by Starx

IMO

  • There is not going to be a 100% correct answer for this.
  • Its totally up to the design of the application.

But, if the same loader is used through out the site, and nothing is loaded outside AJAX, then its probably a good idea to keep the div in the layout and keep it hidden until needed.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!