0

I try to load through Ajax a Drupal page. It works, but not with all the links. I have a main menu, here it works always fine.

Components such as the submenu, internal links, more links, etc. will not be called with Ajax. These are loaded in the standard way.

My Ajax call:

    var selector = 'a';
    $(selector).click(function(e) {
        e.preventDefault();
        $.ajax({
            url: $(this).attr('href') + '?ajaxrequest',
            success: function(data) {
            // my stuff
            }
        });
    });

The strange thing is the first click does not work but the second click works fine and the ajax call works as well on the second click. No matter what kind of link you click.

Has someone any idea? Thanks a lot!

Semi Bold
  • 1
  • 1

0 Answers0