Answer the question
In order to leave comments, you need to log in
Why doesn't JavaScript work on WordPress?
Urgently!!! The customer had to embed one element into the WP site. There styles, a script are just used. Well, I did everything as expected, I specifically used pure JS, without jQuery. Everything works for me, but he does not. Why? There was one piece of code, in which there are already scripts and styles, and html itself. I have never worked with WP. Help!!!
Maybe you need to write JS in the head, or throw it out in a separate file, or include something. I have never worked with WP
Here is the text of the error:
Uncaught ReferenceError: imtc_calculation is not defined
at <anonymous>:1:1
<script>
function imtc_calculation() {
...
}
</script>
<form onsubmit="imtc_calculation(); return false;">...</form>
Answer the question
In order to leave comments, you need to log in
https://jsfiddle.net/yarkov_aleksei/q7tcoans/
<script>
function imtc_calculation() {
alert('imtc_calculation');
}
</script>
<button onclick="imtc_calculation();">CLICK</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question