Skip to content
Advertisement

Creating an extension js inclusion problem

I am creating a small plugin with JS animation. In my plugin, I created an index.php file for my shortcode, functions.php to call my JS code and a JS file for the animation. Anyway my shortcode works, but not the animation

So I called all these files in my console, it seems to tell me that I don’t have an error. But when I want to make my JS work it doesn’t work.

Here is my code.

Index.php

JavaScript

functions.php

JavaScript

script.js

JavaScript

Advertisement

Answer

The Only problem I have seen is just the way you are invoking the Javascript function name.

This is not the correct way for inline invoking

JavaScript

It should be like this

JavaScript

I just added parenthesis to the myTest function name

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement