阻止图像映射器工作的 jQuery 错误



我遇到了来自第三方的脚本无法正常工作的问题。我得到的错误是:

"Uncatch TypeError: jQuery(...(.图像映射器不是一个函数">

我尝试过几次解决这个问题,似乎没有任何效果。任何帮助或想法将不胜感激。下面是脚本:

(function() {
var mapper_63_loadScript = function(url, success) {
var script = document.createElement('script');
script.src = url;
var head = document.getElementsByTagName('head')[0],
done = false;
script.onload = script.onreadystatechange = function() {
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
done = true;
success();
script.onload = script.onreadystatechange = null;
head.removeChild(script);
}
};
head.appendChild(script);
};
var mapper_63_execute_scripts = function() {
jQuery('.imagemapper63-wrapper').imageMapper({
itemOpenStyle: 'click',
itemDesignStyle: 'responsive',
responsiveWidth: 600,
transformSmall: 1,
oldResponsive: 0,
animateOther: 1000,
pinScalingCoefficient: 1,
advancedPinOptions: true,
pinClickAction: "content",
pinHoverAction: "my_content",
useTransitions: '1',
animationDuration: 170,
mapOverlay: true
});
};
if ((typeof jQuery === 'undefined') || (parseInt(jQuery.fn.jquery) === 1 && parseFloat(jQuery.fn.jquery.replace(/^1./, "")) < 9.1)) {
mapper_63_loadScript('//code.jquery.com/jquery-2.2.3.min.js', function() {
mapper_63_loadScript('https://easy-image-mapper.herokuapp.com/shopify_image_mapper.js?shop=mustaevusa.myshopify.com', function() {
mapper_63_execute_scripts();
});
});
} else {
mapper_63_loadScript('https://easy-image-mapper.herokuapp.com/shopify_image_mapper.js?shop=mustaevusa.myshopify.com', function() {
mapper_63_execute_scripts();
});
}
})();

将调用移动到第 7 行的 readystate 处理程序中mapper_63_execute_scripts();

您正在尝试在浏览器中可用之前调用该代码。

最新更新