Jon Imms
asked on
Uncaught TypeError: Cannot read property 'open' of undefined
Hi there, I am getting a Uncaught TypeError: Cannot read property 'open' of undefined error, on Line 14. This is a function, that will open a popup on page load. Not sure hoe to rectify it?
jQuery(document).ready(function($) {
// Parse the URL
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var access = getParameterByName('access');
// if access does not = yes then display the popup
if (access != 'yes') {
$.magnificPopup.open({
items: {
src: 'https://go.buildertrend.com/l/464372/2020-03-20/7sshdx'
},
type: 'iframe', modal: true
});
}
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.