Here, Edward 👨🏻‍💻


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:


// 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 */ });


// 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.

이 글은 에서 옮겨온 글입니다.
Posted by
사소한 이야기를 많이 나누고 싶어하는 해커. 티끌 같은 기술들이 세상을 바꾼다고 믿습니다.
© 2011-2018 Edward Kim Some Rights Reserved.?