S
S
Svmaks2018-10-06 21:10:07
JavaScript
Svmaks, 2018-10-06 21:10:07

Javascript works fine in codepen but after integrating into Wordpress it gives NaN, what's wrong?

Hello.
Prepared the script "product calculator for the site" on jQuery. I check on codepen everything works. I transfer to wordpress, the script works but produces NaN.
I connect HTML and CSS through a shortcode, I connect JS from a file.
jQuery starts earlier, along with ContactForm 7
Link to codepen: https://codepen.io/svmaks/pen/xyEpJb
Please tell me what's wrong, why does everything work in codepen and gives NaN in wordpress?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lamer350, 2018-10-06
@lamer350

$('input:checkbox:checked').each(function(){ ...
You need to specify better which input you are referring to, due to the fact that you have CF7 - your script takes into circulation all inputs from CF7 as well, hence the error.

V
Vladimir, 2018-10-06
@Casufi

There is a developer tools in chrome and fox, set breakpoints and see. You give a link to a working codepen so that you can be diagnosed with a broken WordPress. Strange idea.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question