-
AuthorPosts
-
May 19, 2015 at 9:11 pm #277384
Hi,
I’m not using flexslider but I keep getting this error in my console. Can you please tell me why this is occurring?
Thank you!
May 20, 2015 at 1:42 am #277510Hi,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
October 2, 2015 at 7:25 am #608012Hi,
I’ll just bring this thread back to life if anyone else finds it. I’ve got the same serror on my website. And it looks like its from the cornerstone plugin. The website is: http://www.accbox.net/
October 2, 2015 at 7:58 am #608054Upon checking your site, it seems that you’re using CloudFront CDN and this could be a related issue. Could you please try switching off CloudFront CDN so that we can isolate the issue.
Let us know how it goes.
October 2, 2015 at 8:12 am #608073Remove the javascript code that is loading the CloudFront CDN does fix the problem. But the service that is generating our forms is using it, so I’m not really able to stop using it 🙁 Do you have a fix or a better idea what would be the problem, maybe there is something our form provider can do…
October 2, 2015 at 9:28 am #608168Hi there,
Thanks for the additional information, could you please share the javascript code you’re using to load CloudFront?
We’re here to help. 🙂
Thank you!
October 3, 2015 at 4:13 am #609137Hi,
this is the tracking code from the software (net-results marketing automation platform)
This one does not yet load from CloudFront, but the form code needs this javascript to work.<script id="__maSrc" type="text/javascript" data-pid="12915"> (function () { var d=document,t='script',c=d.createElement(t),s=(d.URL.indexOf('https:')==0?'s':''),p; c.type = 'text/java'+t; c.src = 'http'+s+'://'+s+'c.cdnma.com/apps/capture.js'; p=d.getElementsByTagName(t)[0];p.parentNode.insertBefore(c,p); }()); </script>
And this is the form code, that loads up the form and uses CloudFront:
<div id="MAform-84d2fe27-8434-4535-826b-74fadd5a13b6" class="MAform"> <script type="text/javascript"> (function() {var $__MAForm;($__MAForm=function(){if(typeof($__MA)=='undefined'){return window.setTimeout($__MAForm,50);}else{ $__MA.addMAForm('84d2fe27-8434-4535-826b-74fadd5a13b6', 'forms.accbox.net'); }})();})(); </script> </div>
October 3, 2015 at 5:26 am #609191Hi Frod,
Thanks for the code!
Upon checking, I can see your site is still being cached. Can you try clearing WP Rocket and disabling it? Please also provide us with your WordPress login credentials so we can take a closer look to the issue. Don’t forget to select Set as private reply to ensure your data remains hidden from other users.
Thanks!
October 5, 2015 at 3:46 am #610862This reply has been marked as private.October 5, 2015 at 4:20 am #610884Hi there Frod,
Thanks for posting back, I’ve tried to take a look at this for you, but the wp-admin is only for the main site.
Would it be possible to get network admin and FTP please so we can further debug?
Remember to set your reply as private, so only staff can see it. 🙂
Thank you!
October 5, 2015 at 6:22 am #611025This reply has been marked as private.October 5, 2015 at 8:01 am #611179Hi there Frod,
I believe I’ve found the issue here, it seems the script you posted above, calls another script, which is causing the issue.
As the script being loaded doesn’t use no conflict wrappers. The script needs to use jQuery noconflict, https://api.jquery.com/jquery.noconflict/
You will see WordPress examples here https://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers
So one way round this, maybe to write a small custom plugin and enqueue the scripts with the script modified for noconflict.
I hope this helps. 🙂
Thanks!
October 5, 2015 at 8:21 am #611196Thanks, I’ll contact the other solution support and request the fix before I go into writing the script 🙂
Thanks again
October 5, 2015 at 8:29 am #611211You’re most welcome, let us know if we can be of any further assistance. 🙂
Thanks!
October 9, 2015 at 7:26 am #618034Hi,
I’ve been in contact with the forms provider and got a similar answer you gave me:
Unfortunately, jquery noConflict does not mean that a script will not affect the environment, but only that once it’s done affecting the environment, it will revert control.
In this case, the version on the page is loaded along with the initial page. Then, in stage 2, all of the non-required assets are executed. During this stage, the forms for the page are built and the plugin into call flexslider are called at the same time.
While the forms are built, we are using our version of jquery. Note that the version numbers are not the issue here, the issue is that the page’s jquery has flexslider bundled while vanilla jquery does not. The vanilla jquery our forms need is loaded, the forms begin rendering but at that very moment the page’s jquery tries to load the flexslider plugin. Shortly thereafter the forms are rendered and the forms return jquery to the page’s original jquery.
There are a few ways around this, but you will have to implement one or more of them as they are all very page/site/wordpress specific and cannot be fixed by our code.
#1. Load our forms after the flexslider has loaded. (i.e. after cs-body.min.js loads & executes)
#2. Load our forms before flexslider. (perhaps after document.ready? I cannot tell as your code is minified.)
#3. Separate the flexslider plugin from the bundled with jquery asset, and instead call the plugin initialization and plugin construction simultaneously.Either way, we need to prevent the forms & flexslider code from executing at the same time. The reason they are happening at the same time is they are both in “stage 2” of DOM rendering.
But now I’m stuck. I have no idea how to “block” one script and let another one finish before it. Or how to check that cs-body.min.js finished executing so I can then allow the form script to start loading.
I found ways how to separate jQueries and use them with different variables (instead of the predefined $ variable). And I know how to add a callback function after a script is done executing. But do you think I can achieve what I want with a third script (a plugin) that would handle this. Can you point me in the right direction?Thanks!
-
AuthorPosts