JavaScript not added
-
Hi,
I added this simple code to a WordPress post:
<button type="button" onClick="doSomething()">Do Something</button>
and in the
This code will be included verbatim in <script> tags at the end of your page’s (or post’s) …
form I added the following code:
function doSomething() { console.log('called') }
I click
Update Scripts
and thenPreview
. In the preview page however, if I click the button, nothing happens, and the console shows:ReferenceError: doSomething is not defined
. In fact, it turns out that my code is not present in the page. I’m using the Independent Publisher 2 theme. What could be the problem?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘JavaScript not added’ is closed to new replies.