dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.38k stars 3.49k forks source link

AJAX #384

Open softshape opened 10 years ago

softshape commented 10 years ago

Hi all,

why this inline code works ok -

  $.magnificPopup.open({
    items: {
      src: '#popup',
      type: 'inline'
    }
  });    

and similar AJAX does not ?

  $.magnificPopup.open({
    items: {
      src: '/files/wrk/oneline.htm',
      type: 'ajax'
    }
  });  

It causes "TypeError: n[(("get" + c.charAt(...).toUpperCase(...)) + c.slice(...))] is not a function" error. What is the correct syntax for AJAX type in .open() function ?

rahmanusta commented 8 years ago

Same issue. Is there any solution ?

mauricius commented 8 years ago

Same error here. Solved with 1.0.1.

mikerockett commented 7 years ago

I'm getting this error for inline popups.

$('.mfp-popup-link').magnificPopup({
    type: 'inline', preloader: false, midClick: true
});
<p><a href="#video{{ index }}" class="mfp-popup-link"><img class="noStyle" src="{{ video.video_thumb.url }}" alt="Video {{ index }}"></a></p>

<div id="video{{ index }}" class="mfp-hide">
    <video class="video-js" controls preload="auto" width="800" height="600" poster="{{ video.video_thumb.url }}" data-setup="{}">
        <source src="{{ video.video_file.url }}" type='video/mp4'>
        <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
    </video>
</div>

Ideas? Or am I doing something wrong in the context of videos?

dboulet commented 7 years ago

I was getting this error for inline popups. Turns out that I was using a custom build of the plugin which didn’t include the ‘inline’ module. Solved it by creating a new build.