I am trying to implement magnific popup
I am having following link <a class="simple-ajax-popup" href="/index.json">load json</a>
When I click the link, lightbox is in loading state and throws an exception as
Uncaught TypeError: Cannot call method 'createDocumentFragment' of undefined
I am using rails 4 and also I have jquery-fileupload
plugin but it is working.
Please, read this Documentation: content type
You could not use json as html. You should wrap json to html. What You could do?
Something like this:
$.magnificPopup.open({
items: {
src: '<div class="white-popup">Dynamically created popup</div>', // can be a HTML string, jQuery object, or CSS selector
type: 'inline'
callbacks: {
open: function() {
$.getJSON("/index.json").done(function( data) {
data.each( function(index, value) {
$("div.white-popup").append(value);
});
})
},
close: function() {
// Will fire when popup is closed
}
});
I hope it help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With