4

I'm using magnific popup and ajax loading content into it and passing values to the ajax content by appending a query string to the url, which works fine except in IE7 (and probably IE8 as well). The reason is very likely the length of the query string, because it works when I shorten it.

So my question is, is it possible to pass it via some sort of data setting and make it use POST instead of GET. Or does it already use post and I just need to use the right method.

This is what I have:

$.magnificPopup.open({
  tLoading:"",
  modal:false,
  type:'ajax',
  alignTop:true,
  items:{src:urlContainingVeryLongQueryString},
  callbacks:
  {
    ajaxContentAdded:function()
    {
    ...

My test url is 906 characters long in total (well within IE7's 2000ish limit).

Graham
  • 7,807
  • 20
  • 69
  • 114

1 Answers1

11

ajax.settings option http://dimsemenov.com/plugins/magnific-popup/documentation.html#ajax_type is passed to jQuery.ajax method http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings , e.g.:

$.magnificPopup.open({

    tLoading:"",
    modal:false,
    type:'ajax',
    alignTop:true,
    items:{src:'http://example.com/ajax'},

    ajax: {
      settings: {
        type: 'POST',
        data: { 
            foo: 'bar'
        }
      }
    }
});
Dmitry Semenov
  • 4,566
  • 2
  • 36
  • 39
  • Thank you. I hadn't realised that the magnific ajax propertiy was passed to the jquery ajax functionality. That makes it very flexible. – Graham Jul 31 '14 at 09:05
  • Just had a look at your royal slider - I think we will be using that - looks very comprehensive. http://dimsemenov.com/plugins/royal-slider/ – Graham Jul 31 '14 at 09:16