Here, Edward 👨🏻‍💻

About안녕하세요

Comprehensive Google Map Plugin(CGMP) conflicted with W3 Total Cache

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 에서 옮겨온 글입니다.
Posted by
김용균
사소한 이야기를 많이 나누고 싶어하는 해커. 티끌 같은 기술들이 세상을 바꾼다고 믿습니다.
목록으로
© 2011-2018 Edward Kim Some Rights Reserved.?