1

I have configured Calendar module for event listing, I have a mini calendar block that when clicked should load the events views without refreshing the page.

$("#block-views-calendar-block-1 .mini.has-events a").click(function(e){
          e.preventDefault();
          href = $(this).attr('href');
          console.log(href);
          $.ajax({
          url: Drupal.settings.basePath + 'mymodule/'  + 'load-content' + href,
          type: 'GET',
          //data: data,
          dataType: 'json',
          success: function(response) {
            console.log(response);
            $("#block-system-main").html(response);
          },
          error: function() {
           // show error in any DOM.
          },
      });
          });

I am using views_embed_view function and returning output as json but I get 500 server error.

Any idea how can I achieve this?

Thanks

  • I'm not sure this is a Drupal question, but have you confirmed that the value at (Drupal.settings.basePath + 'mymodule/' + 'load-content' + href) is valid? – calebtr Dec 24 '14 at 9:00
  • Are you still looking for answer :) ? – Ali Nouman Dec 24 '14 at 14:17
  • 1
    No, I figured it out yesterday. There was some issue with my views and further I replaced type from json to html – Shabir A. Dec 24 '14 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.