The error says:
Uncaught TypeError: Cannot read property 'open' of undefined
I included jQuery library first, then magnific pop up.
I loaded magnific pop up using this code:
/******** Called once jQuery has loaded ******/
function scriptLoadHandler(){
loadScript(app_url + "embed/facebook-events/libs/js/magnific-popup/jquery.magnific-popup.min.js", function(){
loadScript(app_url + "embed/facebook-events/libs/js/jquery.linkify.min.js", function(){
// Restore $ and window.jQuery to their previous values and store the
// new jQuery in our local jQuery variable
$ = jQuery = window.jQuery.noConflict(true);
if(jQuery==undefined){
console.log('jQuery is UNDEFINED.');
}else{
console.log('jQuery is NOT UNDEFINED.');
}
if(jQuery.magnificPopup==undefined){
console.log('jQuery.magnificPopup is UNDEFINED.');
}else{
console.log('jQuery.magnificPopup is NOT UNDEFINED.');
}
// Call our main function
main();
});
});
}
loadScript looks like this:
function loadScript(url, callback){
/* Load script from url and calls callback once it's loaded */
var scriptTag = document.createElement('script');
scriptTag.setAttribute("type", "text/javascript");
scriptTag.setAttribute("src", url);
if (typeof callback !== "undefined") {
if (scriptTag.readyState) {
/* For old versions of IE */
scriptTag.onreadystatechange = function(){
if (this.readyState === 'complete' || this.readyState === 'loaded') {
callback();
}
};
} else {
scriptTag.onload = callback;
}
}
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(scriptTag);
}
I'm using magnific popup here: http://www.126armyband.com/schedule-1.html
I loaded / included the library via JavaScript
On some websites it works, but it is not working on this site http://www.126armyband.com/schedule-1.html
The error says: Uncaught TypeError: Cannot read property 'open' of undefined
I included jQuery library first, then magnific pop up.
I loaded magnific pop up using this code:
loadScript looks like this:
Then I use it in the pop up:
Please help.