JavaScript

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:

create a plugin to enqueue them with wp_enqueue_script
upload them somewhere and insert the necessary tags

If you have code that looks like  from your typography, analytics, or other 3rd party cloud provider, read this article on adding code to or before .

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注