Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Latest version of Chrome throwing errors for PVii js files
#1
The latest version of Chrome has deprecated the unload event, see https://developer.chrome.com/docs/web-pl...ing-unload, this is causing issues with a lot of PVII's scripts. In my case on the site I am working on both AMM and MBX are affected.

The fix is to change the unload event to before unload like so:

Code:
function P7_MBXaddLoad(){
var ie = P7_MBXgetIEver();
if (!document.getElementById || (ie > 0 && ie < 6)) {
return;
}
if (window.addEventListener) {
document.addEventListener("DOMContentLoaded", P7_MBXinit, false);
window.addEventListener("load", P7_MBXinit, false);
//window.addEventListener("unload", P7_MBXbb, false);
window.addEventListener("beforeunload", P7_MBXbb, false); // Changed from unload to beforeunload
document.addEventListener("keydown", P7_MBXkey, false);
window.addEventListener("resize", P7_MBXrsz, false);
} else if (window.attachEvent) {
document.write("<script id=p7ie_mbx defer src=\"//:\"><\/script>");
document.getElementById("p7ie_mbx").onreadystatechange = function(){
if (this.readyState == "complete") {
if (p7MBX.ctl.length > 0) {
P7_MBXinit();
}
}
};
window.attachEvent("onload", P7_MBXinit);
window.attachEvent("onunload", P7_MBXbb);
document.attachEvent("onkeydown", P7_MBXkey);
window.attachEvent("onresize", P7_MBXrsz);
}
}


Hope that helps
Reply
#2
Thank you! I will go through all of my sites this week to make the change, since they ALL use AMM. 

Most appreciated!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)