Hello all,
I may be not doing this the proper way, but basically I am using ajax content loading. It works ok, but there is an issue with loading views. Basically, the paging does not work when I first load a view. All the content is displayed and at the bottom of the page there is the paging buttons.
As soon as I press one of the paging buttons (ie. got to next page) , views start to work properly.
This is how I do it:

jQuery(document).ready(function() {
    jQuery('#menu li a').unbind('click').click(function(){
    var href = jQuery(this).attr('href');
    var toLoad = href+' #content';  
    loadContent();
    jQuery('#content').hide('slow',loadContent);
    jQuery('#load').remove();
    jQuery('#main-wrapper').append('<span id="load">LOADING...</span>');
    jQuery('#load').fadeIn('normal');

    function loadContent() {
        jQuery('#content').load(toLoad,'',function(){showNewContent()});
    }
    function showNewContent() {
        jQuery('#content').show('normal',hideLoader());
    }
    function hideLoader() {
        jQuery('#load').fadeOut('normal');
    }
});

Any input is appreciated to direct me to the proper way.

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

You probably need Drupal.attachBehaviors()

I don't know much about jQuery.load() -- I've never used it, so I can't really speak for what you're doing wrong. Unfortunately we do not have the resources to debug your custom code for you for free.