Oxygen 3.9 is now available - see what's newlimited time special pricing available
docs PHP, CSS & JS

JavaScript

You can write JavaScript and jQuery in Oxygen and see the results live.

Adding JavaScript to an element

Each element can have its own JavaScript. Click the Advanced > JavaScript tab to access the JavaScript editor.

%%ELEMENT_ID%% will be replaced with the actual ID of the element.

Example:
jQuery('#%%ELEMENT_ID%%').click(...)

Adding JavaScript to your page or template

Do you want to add custom JavaScript to your page or template? Add a Code Block (+Add > Basics > Code Block). Then click JavaScript to open the JavaScript editor.

Using jQuery

As is default with WordPress, jQuery is loaded automatically. To use jQuery, write jQuery('...'), not $('...').

Loading External JavaScript Libraries

You may load external JavaScript libraries in one of two ways:

If you have code that looks like <script src='somescript.js /> from your typography, analytics, or other 3rd party cloud provider, read this article on adding code to <head> or before </body>.

Last modified: June 6, 2020
Copyright © 2021 Soflyy
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram