screen hangs on ajax div update, using ajaxSubmitButton


<div class="row submit">

		<?php echo CHtml::ajaxSubmitButton(

            'Search',

						CController::createUrl('user/search'),

            array(

              'update'=>'#ajaxUpdate',

              'cache'=>true,

							'beforeSend' => 'function(){

                $("#ajaxUpdate").addClass("loading");

              }',

            ),

						array(

							'id'=>'search',

						)

          );

    ?>

	</div>

Using this, i’m trying to update div id #ajaxUpdate. Now when net connection is slow, or takes time to load the results, full screen hangs! What is the use, if i’m using ajax, to keep screen interactive and it is not achieved!

Please help me with some solution… what is making screen hang?

Bump

Sorry, to bump. but I’m still having this problem… Is there any solution?

what do you mean screen hangs? your browsers freezes? i guess you may be mislead by the fact that you activate loading indication and you never switch if off.

to better understand your problem please try this code and let me know if things are better:


 <?php echo CHtml::ajaxSubmitButton(

            'Search',

            CController::createUrl('user/search'),

            array(

              'update'=>'#ajaxUpdate',

              'cache'=>true,

              'beforeSend' => 'function(){

                $("#ajaxUpdate").addClass("loading");}',

              'complete' => 'function(){

                $("#ajaxUpdate").removeClass("loading");}',

            ),

                                                array(

                                                        'id'=>'search',

                                                )

          );

    ?>

        </div>

oops, I forgot to post


'complete' => 'function(){

                $("#ajaxUpdate").removeClass("loading");}',



It is there in my code! Its just browser freezes until data is loading. Once done, it gets normal again.

Even if I don’t add that class “loading” , it still freezes!

Try to use search on following link,

http://hubsonline.byethost3.com/ if net is at moderate speed, you will find difference, else I am not sure!

Please let me know if you find the same problem…

I had no problem searching your forms…not at all

Thanks for reply! Seems, if net is slow, then only it hangs, until it gets results… !

What I noticed is, when dom is getting updated and simultaneously results are loading in the background… then it hangs!