When I installed W3 Total Cache, It was always problem with Comprehensive Google Map Plugin. Although W3 Total Cache is awesome plugin, I couldn’t use it for this problem. I spent time today and I found what problem is.

It was problem with JSON parsing. In W3 Total cache, every page minify by replacing space to new line(\n). So we can fix a code like below:

/plugins/comprehensive-google-map-plugin/assets/js/cgmp.framework.js

// CGMPGlobal.errors = parseJson(CGMPGlobal.errors);<br /> CGMPGlobal.errors = parseJson(CGMPGlobal.errors.replace(/\n/gi,""));

And then, wrapping jQuery. It need to be run after jQuery loaded.

jQuery(function(){ /* all code */ });

/plugins/comprehensive-google-map-plugin/assets/js/cgmp.framework.min.js

// find w(i) and then change to the code<br /> w(i.replace(/\n/gi,""))

Also wrapping jQuery in same way.

jQuery(function(){ /* all code */ });

I hope you get answer what you want.

이 글은 https://www.haruair.com/blog/1661 에서 옮겨온 글입니다.
© 2011-2019 Edward Kim Some Rights Reserved.?