Unlock your potential with a Pro Membership
Here is where you propel your career forward. Come join us today. Learn more.
Loading Scripts
Lab: Introduction to jQuery and JavaScript
Video Runtime: 10:47
Let’s get out of the browser’s console and write your first script. In this episode, you will simply create a script file and then learn how to load that file into the DOM through WordPress. Yes, you will learn about enqueuing script files using the WordPress event wp_enqueue_scripts
and its function wp_enqueue_script
.
Correction Time
Whoopsie, I made an error in the URL for the asset. Instead of this:
SANDBOX_WORKSPACE_URL . '/assets/js/my_script.js'
it should be:
SANDBOX_WORKSPACE_URL . 'assets/js/my_script.js'
Why? The constant SANDBOX_WORKSPACE_URL
has a trailing slash built into it. Go ahead and do ddd( SANDBOX_WORKSPACE_URL );
to see for yourself.
Psst…if you need to learn about WordPress’ event-driven engine (you know that thing in Core that handles hooks/filters), go take this hands-on lab.
Your best friend is code, Tonya is making the introductions.
Episodes
Total Lab Runtime: 02:32:33
- 1 Lab Introductionfree 10:05
- 2 Document Object Model (DOM)free 08:23
- 3 Select Elements from the DOMfree 13:48
- 4 The Why of jQueryfree 04:46
- 5 Variablespro 14:42
- 6 Traverse the DOMpro 17:08
- 7 Basic Animation Effectspro 09:16
- 8 Data Typespro 15:44
- 9 Basic Eventspro 09:53
- 10 Loading Scriptspro 10:47
- 11 Declaring Functionspro 05:28
- 12 Meet the IIFEpro 09:03
- 13 jQuery's $pro 04:14
- 14 Scopepro 09:44
- 15 Cachingpro 03:34
- 16 Wrap It Uppro 05:58