Slow Ajax CJuiTabs

Hey guys,

I am using a CJuiTabs widget in my application with tab content being loaded through ajax.

It all works fine but what bothers me is the ajax latency, the ajax request is extremely slow.

(I use beginRequest and complete to display a "loading…" notification on screen).

I wonder what might be the reason for that.

Loading the page directly through the URL is fast.

Ajax requests submitted at other places in the application are extremely fast.

So I ruled out a network or server related problem.

Anyone has experienced that? Any thoughts?

Best

Hi,

I’m using CJuiTabs widget in my project. It was fast in local area network when loading content via ajax. However, it will take 3-5 seconds on the internet.

How to use beginRequest and complete to display a "loading…" notification on screen

Hi,

you need to declare and style a hidden <div /> to hold the "loading…" message.




<div id="tab-loading" class="loading" style="display:none;"> Loading...</div>



Then you pass the following option to the CJuiTabs:




'ajaxOptions'=>array(

    'beforeSend'=>'js:function(request, settings) { $("#tab-loading").show(); }',

    'complete'=>'js:function(request, settings) { $("#tab-loading").hide(); }',

),