0

I have a website which is loading Maximage in the footer with a few other scripts. All these work well and have since I built my site, but a third party wordpress plugin from Axcelerate (an online student and courses api) comes up with an error, which I can only remedy by removing the jquery link at the end of the html page.

The problem comes up when going through the booking process found by clicking "Book Now" on this page Course Page and then clicking "new user" and "next".

The error comes up as,

VM10448:34 Uncaught TypeError: $(...).validate is not a function

I have tried other versions of jquery, alternate load methods, changing how wordpress loads its javascript and also moving my websites javascript to the head instead of the footer. Now I am a bit stuck and don't know what other avenues to look into to get this functioning.

Milap
  • 6,915
  • 8
  • 26
  • 46
martyish
  • 31
  • 10

1 Answers1

0

Your error is not only confined to the virtual machine (this is what VM means). You can click on the little arrow next to the error and you'll see this:

(anonymous function)    @   VM184:34
fire                    @   jquery.js:3119
add                     @   jquery.js:3165
jQuery.fn.ready         @   jquery.js:3399
jQuery.fn.init          @   jquery.js:2839
jQuery                  @   jquery.js:73
(anonymous function)    @   VM184:3
(anonymous function)    @   jquery.js?ver=1.12.4:2
globalEval              @   jquery.js?ver=1.12.4:2
Ha                      @   jquery.js?ver=1.12.4:3
append                  @   jquery.js?ver=1.12.4:3
(anonymous function)    @   jquery.js?ver=1.12.4:3
Y                       @   jquery.js?ver=1.12.4:3
html                    @   jquery.js?ver=1.12.4:3
success                 @   jquery.smartWizard.js?ver=4.5.3:189
i                       @   jquery.js?ver=1.12.4:2
fireWith                @   jquery.js?ver=1.12.4:2
y                       @   jquery.js?ver=1.12.4:4
c                       @   jquery.js?ver=1.12.4:4

Now the fact that your code with the .validate() method from jQuery validate plugin gives error in the virtual machine suggests that your code is probably embedded in the page DOM itself, and not in the separate file. When you search it in the Elements tab, you can find it underneath the form.

Go through the plugin and try to see if you can remove that script underneath the form and add it to a file that you can enqueue so that it will depend on the validation plugin. This should solve the issue.

Your validation plugin is located in the header, and technically should work, but try to enqueue it in the footer, maybe this will help.

Community
  • 1
  • 1
dingo_d
  • 11,160
  • 11
  • 73
  • 132
  • Thankyou for your help. I did have a look at the drop down, but was having trouble figuring out what it meant (further than it having a problem calling .validate() as I didn't recognise where the problem or the call was actually occoring. When it states that is in a file such as VM184:3 it is saying line 3 of something just located generally in the DOM? So am I right in my understanding that to fix this problem I would need to modify the plugin rather than my website theme? Thankyou again for your time. It is very much appretiated :) @dingo_d – martyish Jun 29 '16 at 06:44
  • Jup, this code happens in the DOM, and if the form is generated with the plugin, then it's plugin's fault. – dingo_d Jun 29 '16 at 06:46