SlideShare une entreprise Scribd logo
1  sur  100
Télécharger pour lire hors ligne
Developer Advocate @ Oracle
June 4, 2020
Dan McGhan
for APEX Developers
Intro to JavaScript
Copyright © 2020, Oracle and/or its affiliates2
3
2
1
Working with the DOM and jQuery
Adding JavaScript to APEX Apps
JavaScript Basics
Agenda
Next Steps
Q & A
4
5
Copyright © 2020, Oracle and/or its affiliates3
Part 1: JavaScript Basics
Copyright © 2020, Oracle and/or its affiliates4
5
4
3
2
1
Objects and functions
Conditionals and loops
Operators
Variables and data types
Why JavaScript?
JavaScript Basics
Developer tools6
Copyright © 2020, Oracle and/or its affiliates5
5
4
3
2
1
Objects and functions
Conditionals and loops
Operators
Variables and data types
Why JavaScript?
JavaScript Basics
Developer tools6
Copyright © 2020, Oracle and/or its affiliates6
If you're looking for a great APEX
developer, you're really looking for
a full-stack developer.
https://joelkallman.blogspot.com/2017/10/a-great-apex-developer-isa-full-stack.html
“
Joel Kallman, co-creator of APEX
Copyright © 2020, Oracle and/or its affiliates7
Server-side Client-side
Oracle Database
Data Modeling
SQL
PL/SQL
Copyright © 2020, Oracle and/or its affiliates8
Copyright © 2020, Oracle and/or its affiliates9
Copyright © 2020, Oracle and/or its affiliates10
Server-side Client-side
Oracle Database
Data Modeling
SQL
PL/SQL
HTML
CSS
JavaScript
Copyright © 2020, Oracle and/or its affiliates11
Your goal is not to be the master…
Copyright © 2020, Oracle and/or its affiliates12
Your goal is not to be the master…
It often takes just a few lines of JavaScript
to deliver functionality not available out-of-the-box!
Copyright © 2020, Oracle and/or its affiliates13
JavaScript
• Designed to program the web
• 3rd generation language
- Based on Scheme, C++, and Java
• Flexible/based on functions
PL/SQL
• Designed to extend SQL
• 3rd generation language
- Based on Ada
• Procedural/block structured
Languages at a glance
Copyright © 2020, Oracle and/or its affiliates14
5
4
3
2
1
Objects and functions
Conditionals and loops
Operators
Variables and data types
Why JavaScript?
JavaScript Basics
Developer tools6
Copyright © 2020, Oracle and/or its affiliates15
• Scope works by blocks
- Nested blocks see outer scope
• Declaration done in the declaration section
• Strongly typed: specify name and data type
- Data type will not change
• Not case sensitive (by default)
Declaring variables in PL/SQL
Copyright © 2020, Oracle and/or its affiliates16
• Scope works by functions
- Outside of functions = global scope
- Nested blocks see outer scope
• Declaration can be done anywhere
- Best practice is to declare at top of function
• Use var to declare a variable in a function
- let and const aren’t well supported in IE 11
• Weakly typed: variables don’t have types
- Values have types
• Case sensitive (always)
Declaring variables in JavaScript
Copyright © 2020, Oracle and/or its affiliates17
• All SQL types
• Plus many PL/SQL only types
Common data types in PL/SQL
Scalars
NUMBER PLS_INTEGER CHAR
VARCHAR2 BOOLEAN DATE
TIMESTAMP TSWTZ TSWLTZ
Large Objects
CLOB BLOB
Composites
Records Collections
Other
NULL
Copyright © 2020, Oracle and/or its affiliates18
Common data types in JavaScript
Primitive type Object
Undefined Null
String Number Boolean
Object
Array
Date
Function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures
Copyright © 2020, Oracle and/or its affiliates19
Common data types in JavaScript
Primitive type Object
Undefined Null
String Number Boolean
Object
Array
Date
Function
https://www.youtube.com/watch?v=wPBjd-vb9eI
Uses IEEE 754 math
.1 + .2 = 0.30000000000000004
Copyright © 2020, Oracle and/or its affiliates20
• Literal
- Simpler than a constructor function
- Supported by all primitives and basic objects
- Date not supported
• Constructor function
- Uses new keyword with constructor function
- Use when object literal not available
Two syntaxes for creating new objects
Copyright © 2020, Oracle and/or its affiliates21
5
4
3
2
1
Objects and functions
Conditionals and loops
Operators
Variables and data types
Why JavaScript?
JavaScript Basics
Developer tools6
Copyright © 2020, Oracle and/or its affiliates22
Using “objects” - PL/SQL vs. JavaScript
Copyright © 2020, Oracle and/or its affiliates23
Using “objects” - PL/SQL vs. JavaScript
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics
Copyright © 2020, Oracle and/or its affiliates24
Functions overview
PL/SQL JavaScript
Functions Yes (must return a value) Yes (optionally return a value)
Procedures Yes (does not return a value) No (use a function with no return value)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions
Copyright © 2020, Oracle and/or its affiliates25
Creating functions in JavaScript
Function statement
Copyright © 2020, Oracle and/or its affiliates26
Creating functions in JavaScript
Function statement Function expression
Copyright © 2020, Oracle and/or its affiliates27
Using functions - PL/SQL vs. JavaScript
Copyright © 2020, Oracle and/or its affiliates28
Using functions - PL/SQL vs. JavaScript
Copyright © 2020, Oracle and/or its affiliates29
• Functions are a lot like other data types (numbers, strings, etc.)
• Can be assigned to variables and passed around as parameters
• Can be returned from other functions
Functions are 1st class in JavaScript
Copyright © 2020, Oracle and/or its affiliates30
JavaScript objects/functions in browsers
Object Description
window THE “global” object. Represents the browser window. (think SYS schema)
document API to the document/web page. We’ll cover this later.
console API for debug output. (think dbms_output)
JSON Object that provides tools for working with JSON, e.g. JSON.parse & JSON.stringify.
setTimeout Function to schedule work for the future (think dbms_scheduler)
setInterval Function to schedule recurring work (think dbms_scheduler)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference#Global_Objects
Copyright © 2020, Oracle and/or its affiliates31
Pop quiz!
Which of the following will not throw an exception?
A B C
Copyright © 2020, Oracle and/or its affiliates32
5
4
3
2
1
Objects and functions
Conditionals and loops
Operators
Variables and data types
Why JavaScript?
JavaScript Basics
Developer tools6
Copyright © 2020, Oracle and/or its affiliates33
Developer tools for PL/SQL
Copyright © 2020, Oracle and/or its affiliates34
Developer tools for PL/SQL
https://developers.google.com/web/tools/chrome-devtools
Copyright © 2020, Oracle and/or its affiliates35
Part 2: Adding JavaScript to APEX Apps
Copyright © 2020, Oracle and/or its affiliates36
4
3
2
1
Static files
Page and component level attributes
Dynamic Actions with JavaScript hooks
Dynamic Actions
Adding JavaScript to APEX Apps
Copyright © 2020, Oracle and/or its affiliates37
4
3
2
1
Static files
Page and component level attributes
Dynamic Actions with JavaScript hooks
Dynamic Actions
Adding JavaScript to APEX Apps
Copyright © 2020, Oracle and/or its affiliates38
• A declarative way to add dynamic behaviors to a page
- Configure attributes to specify what happens and when
- APEX generates the JavaScript and adds it to the page
• Two parts
- Dynamic Action: the event and related component
- Actions: the response, such as ‘hide’ or ‘show’
What are Dynamic Actions?
Copyright © 2020, Oracle and/or its affiliates39
Thinking through Dynamic Actions
Action
Event
Copyright © 2020, Oracle and/or its affiliates40
Thinking through Dynamic Actions
Action
Event
Action
Action
Copyright © 2020, Oracle and/or its affiliates41
Thinking through Dynamic Actions
Actions
Dynamic Action
Action
Event
Action
Action
Copyright © 2020, Oracle and/or its affiliates42
Thinking through Dynamic Actions
Actions
Dynamic Action
ActionAction
ConditionEvent
False True
Copyright © 2020, Oracle and/or its affiliates43
Thinking through Dynamic Actions
Actions
Dynamic Action
ActionAction
ConditionEvent
False True
Action
Action
Action
Action
Copyright © 2020, Oracle and/or its affiliates44
Thinking through Dynamic Actions
Actions
Dynamic Action
ActionAction
ConditionEvent
False True
Action
Action
Action
Action
Many actions can
be configured to fire
at page load too.
Copyright © 2020, Oracle and/or its affiliates45
• Disable Alternate Number field until the Phone Number is populated
Example 1
Copyright © 2020, Oracle and/or its affiliates46
• Disable Alternate Number field until the Phone Number is populated
Example 1
• What’s the driver?
• Is there a condition?
• What are the true/false actions?
• Relevant at page load too?
Copyright © 2020, Oracle and/or its affiliates47
• Disable Alternate Number field until the Phone Number is populated
Example 1
Actions
Dynamic Action
Disable Alt. PhoneEnable Alt. Phone
Value is nullPhone Num. changes
False True
+ PL + PL
Copyright © 2020, Oracle and/or its affiliates48
4
3
2
1
Static files
Page and component level attributes
Dynamic Actions with JavaScript hooks
Dynamic Actions
Adding JavaScript to APEX Apps
Copyright © 2020, Oracle and/or its affiliates49
• Dynamic Actions can’t cover everything
- Hooks are provided to extend capabilities
- Requires basic knowledge of JavaScript to use
• Probably the sweet spot for most APEX developers
Dynamic Actions with JavaScript hooks
Copyright © 2020, Oracle and/or its affiliates50
• Custom Event option accepts any event name
• jQuery Selector provides a flexible means of selecting elements
Dynamic Action: Event and Selection Type
Action
Dynamic Action
Copyright © 2020, Oracle and/or its affiliates51
• Declarative conditions only work with one item’s value
• The JavaScript Expression option provides full access to the DOM
- Must resolve to true or false
- See the “help” for additional options
Dynamic Action: Client-side Condition
Action
Dynamic Action
Copyright © 2020, Oracle and/or its affiliates52
• Declarative options are great for common interactions
- Hide/show, enable/disable, refresh, etc.
• Execute JavaScript can do anything not available out of the box
Action: Execute JavaScript
Action
Dynamic Action
Copyright © 2020, Oracle and/or its affiliates53
Part 3: Working with the DOM and jQuery
Copyright © 2020, Oracle and/or its affiliates54
5
4
3
2
1
Creating event listeners
Events overview
Selecting, traversing, and manipulating the DOM
What is jQuery?
Understanding the DOM
Working with the DOM and jQuery
Copyright © 2020, Oracle and/or its affiliates55
5
4
3
2
1
Creating event listeners
Events overview
Selecting, traversing, and manipulating the DOM
What is jQuery?
Understanding the DOM
Working with the DOM and jQuery
Copyright © 2020, Oracle and/or its affiliates56
• Hypertext Markup Language (HTML)
- Markup language that browsers understand to render web pages
• Document Object Model (DOM)
- In memory object representation of the HTML document (DOM tree)
- API for working with and manipulating the memory structure
HTML vs. DOM
Copyright © 2020, Oracle and/or its affiliates57
HTML document
http://www.html5rocks.com/en/tutorials/internals/howbrowserswork
Copyright © 2020, Oracle and/or its affiliates58
DOM Tree
http://www.html5rocks.com/en/tutorials/internals/howbrowserswork
Copyright © 2020, Oracle and/or its affiliates59
• The DOM is not a part of JavaScript (the language)
• The DOM is one of many “Web APIs”
- Web APIs make JavaScript useful in a browser
- The DOM API is made available via window.document in browsers
The DOM in JavaScript
JS + Web
APIs
Endless
Possibilities!
😃
=
Copyright © 2020, Oracle and/or its affiliates60
5
4
3
2
1
Creating event listeners
Events overview
Selecting, traversing, and manipulating the DOM
What is jQuery?
Understanding the DOM
Working with the DOM and jQuery
Copyright © 2020, Oracle and/or its affiliates61
• Early DOM APIs were not so good
- Very difficult to use
- Browsers were inconsistent
• jQuery solved the problem
- First released in 2006, when the DOM APIs were still a mess
- jQuery provided simple APIs that worked on all major browsers
• Today, the DOM APIs are improving
- Check out http://youmightnotneedjquery.com
- However, jQuery will be in APEX for the foreseeable future
DOM problems
Copyright © 2020, Oracle and/or its affiliates62
• Step 1: Include the library in the web page
- Already included with APEX
- Adds a function named jQuery in the global scope
- The shortcut $ is more common (also apex.jQuery in APEX)
• Step 2: Select something
- You invoke the jQuery function passing in a “selector” or “query”
- jQuery returns a jQuery object (wraps selected elements)
• Step 3: Do something with what you selected
- DOM manipulation, traversal, events, effects, etc.
Using jQuery
Copyright © 2020, Oracle and/or its affiliates63
5
4
3
2
1
Creating event listeners
Events overview
Selecting, traversing, and manipulating the DOM
What is jQuery?
Understanding the DOM
Working with the DOM and jQuery
Copyright © 2020, Oracle and/or its affiliates64
Basic selectors
Description Syntax Example
ID Selector '#id' $('#message')
Class Selector '.class' $('.boring')
Element Selector 'element' $('ul')
Multiple Selector 'sel1, sel2, selN' $('.fun, #message')
http://api.jquery.com/category/selectors/
Copyright © 2020, Oracle and/or its affiliates65
• DOM APIs return DOM elements
• jQuery APIs return a jQuery object
- Wraps the DOM elements selected
• jQuery objects have their own methods
- Often still easier to use than DOM APIs
- jQuery methods are often chainable
• Access to elements is provided if needed
- Use [] or get
DOM elements vs. jQuery objects
Copyright © 2020, Oracle and/or its affiliates66
Example web page
https://en.wikipedia.org/wiki/Paul_Ekman
Copyright © 2020, Oracle and/or its affiliates67
Example web page HTML
ID
Class
Element
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates68
Selection
ID
Class
Element
$("#question")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates69
Selection
ID
Class
Element
$("#emotions-list")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates70
Selection
Element
ID
Class
$(".positive")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates71
Selection
Element
ID
Class
$(".negative")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates72
Selection
ID
Class
Element
$("div")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates73
Selection
ID
Class
Element
$("input")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates74
Simple traversing
Description Example functions Example
Parents parent, parents, closest $('li.done').parent();
Children children, find $('ul').find('li');
Siblings siblings, next, prev $('li.pending').next();
Filtering eq, filter, first, last $('li').eq(1);
http://api.jquery.com/category/traversing/
Traversal
$("#question")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates75
Traversal
Copyright © 2020, Oracle and/or its affiliates76
$("#question").parent()
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Traversal
Copyright © 2020, Oracle and/or its affiliates77
$("#question").parent().find("li")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Traversal
Copyright © 2020, Oracle and/or its affiliates78
$("#question").parent().find("li").eq(2)
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates79
Simple DOM manipulation
Description Example functions Example
Add/remove classes addClass, removeClass,
toggleClass
$('li.done')
.removeClass('done')
.addClass('pending');
Modify attributes attr, removeAttr, prop,
removeProp, val
$('input')
.attr('disabled', 'disabled');
DOM insertion html, text, append,
prepend
$('ul')
.append('<li>Hello</li>');
DOM removal remove, empty $('ul').empty();
Change CSS styles css $('h1').css('color', 'red');
http://api.jquery.com/category/manipulation/
Manipulation
Copyright © 2020, Oracle and/or its affiliates80
$(".neutral")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates81
$(".neutral").addClass("positive")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral positive">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates82
$(".neutral").addClass("positive").removeClass("neutral")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="positive">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates83
$("input[type='text']")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="positive">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates84
$("input[type='text']").attr("disabled", "disabled")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="positive">Surprised</li>
</ul>
</div>
<input type="text" name="feeling"
disabled="disabled">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates85
$("#question")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates86
$("#question").text("How do you feel?")
<div class="question-wrapper">
<div><h1 id="question">How do you feel?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates87
$("#emotions-list")
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Manipulation
Copyright © 2020, Oracle and/or its affiliates88
$("#emotions-list").append('<li class="positive">Amusement</li>')
<div class="question-wrapper">
<div><h1 id="question">How are you feeling?</h1>
<div>Here are the six basic emotions:</div>
<ul id="emotions-list">
<li class="positive">Happy</li>
<li class="negative">Sad</li>
<li class="negative">Fearful</li>
<li class="negative">Disgusted</li>
<li class="negative">Angry</li>
<li class="neutral">Surprised</li>
<li class="positive">Amusement</li>
</ul>
</div>
<input type="text" name="feeling">
<input type="button" value="Submit">
</div>
Copyright © 2020, Oracle and/or its affiliates89
Part 4: Next Steps
Copyright © 2020, Oracle and/or its affiliates90
https://asktom.oracle.com/pls/apex/asktom.search?oh=8561
Copyright © 2020, Oracle and/or its affiliates91
https://www.qualogy.com/discover-qualogy/news-blogs/news-blog/meet-the-oracle-masters-the-online-series
Copyright © 2020, Oracle and/or its affiliates92
https://bit.ly/intro2js4apex https://bit.ly/js-con-apex
• Current
- https://apex.oracle.com/jsapi
• APEX 20.1
- https://docs.oracle.com/en/database/oracle/application-express/20.1/aexjs/index.html
• APEX 19.2
- https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/index.html
• APEX 19.1
- https://docs.oracle.com/en/database/oracle/application-express/19.1/aexjs/index.html
• APEX 18.2
- https://docs.oracle.com/en/database/oracle/application-express/18.2/aexjs/toc.html
• APEX 18.1
- https://docs.oracle.com/database/apex-18.1/AEXJS/index.html
• APEX 5.1
- https://docs.oracle.com/database/apex-5.1/AEAPI/JavaScript-APIs.htm#AEAPI266
APEX JavaScript APIs
• JavaScript Path
- https://www.pluralsight.com/paths/javascript
• JavaScript Fundamentals for ES6
- https://www.pluralsight.com/courses/javascript-fundamentals-es6
• Rapid ES6 Training
- https://www.pluralsight.com/courses/rapid-es6-training
Pluralsight Paths and Courses on JavaScript
• JavaScript for impatient programmers (HTML version is free)
- https://exploringjs.com/impatient-js/
• You Don’t Know JS (Github book, free)
- https://github.com/getify/You-Dont-Know-JS
• Eloquent JavaScript
- https://www.amazon.com/dp/1593279507
• HTML, CSS, and JavaScript All in One
- https://www.amazon.com/dp/0672338084
Books on JavaScript
• Online Tutorial: Code Academy
- https://www.codecademy.com/learn/learn-jquery
• Book: A Smarter Way to Learn jQuery
- http://a.co/e9Jzxnx
• API Doc
- http://api.jquery.com/
jQuery specific resources
• Fun Fun Function
- https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q
• Lean JavaScript – Full Course for Beginners
- https://www.youtube.com/watch?v=PkZNo7MFNFg
JavaScript content on YouTube
Copyright © 2020, Oracle and/or its affiliates98
Part 5: Q & A
Copyright © 2020, Oracle and/or its affiliates99
Any questions?
Follow me on Twitter
twitter.com/dmcghan
Join me here
JavaScript Basics for APEX Developers

Contenu connexe

Tendances

Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19José Paumard
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKJosé Paumard
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptWojciech Dzikowski
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java ProgrammingMath-Circle
 
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...Edureka!
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features OverviewSergii Stets
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architectureAnurag
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsqlArun Sial
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)arvind pandey
 
Java Introduction
Java IntroductionJava Introduction
Java Introductionjaveed_mhd
 
Classes, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with JavaClasses, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with JavaRadhika Talaviya
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentationritika1
 

Tendances (20)

Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
OOPs in Java
OOPs in JavaOOPs in Java
OOPs in Java
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
Java Tutorial | Java Programming Tutorial | Java Basics | Java Training | Edu...
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features Overview
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architecture
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsql
 
Log4j in 8 slides
Log4j in 8 slidesLog4j in 8 slides
Log4j in 8 slides
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Java
JavaJava
Java
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Classes, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with JavaClasses, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with Java
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 

Similaire à JavaScript Basics for APEX Developers

Module 1: JavaScript Basics
Module 1: JavaScript BasicsModule 1: JavaScript Basics
Module 1: JavaScript BasicsDaniel McGhan
 
Module 2: Adding JavaScript to APEX Apps
Module 2: Adding JavaScript to APEX AppsModule 2: Adding JavaScript to APEX Apps
Module 2: Adding JavaScript to APEX AppsDaniel McGhan
 
Dynamic Actions, the Hard Parts
Dynamic Actions, the Hard PartsDynamic Actions, the Hard Parts
Dynamic Actions, the Hard PartsDaniel McGhan
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsDaniel McGhan
 
Intro to GraphQL for Database Developers
Intro to GraphQL for Database DevelopersIntro to GraphQL for Database Developers
Intro to GraphQL for Database DevelopersDaniel McGhan
 
How to add stuff to MySQL
How to add stuff to MySQLHow to add stuff to MySQL
How to add stuff to MySQLGeorgi Kodinov
 
Serverless patterns
Serverless patternsServerless patterns
Serverless patternsJesse Butler
 
Diagnose Your Microservices
Diagnose Your MicroservicesDiagnose Your Microservices
Diagnose Your MicroservicesMarcus Hirt
 
Apex atp customer_presentation_wwc march 2019
Apex atp customer_presentation_wwc march 2019Apex atp customer_presentation_wwc march 2019
Apex atp customer_presentation_wwc march 2019Oracle Developers
 
APEX Office Hours Interactive Grid Deep Dive
APEX Office Hours Interactive Grid Deep DiveAPEX Office Hours Interactive Grid Deep Dive
APEX Office Hours Interactive Grid Deep DiveJohnSnyders
 
Oracle APEX Introduction (release 18.1)
Oracle APEX Introduction (release 18.1)Oracle APEX Introduction (release 18.1)
Oracle APEX Introduction (release 18.1)Michael Hichwa
 
Oracle Application Express 20.2 New Features
Oracle Application Express 20.2 New FeaturesOracle Application Express 20.2 New Features
Oracle Application Express 20.2 New Featuresmsewtz
 
EBS ECC Data Discovery and Visualization.pdf
EBS ECC Data Discovery and Visualization.pdfEBS ECC Data Discovery and Visualization.pdf
EBS ECC Data Discovery and Visualization.pdfssuserf605b8
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Dave Stokes
 
APEX – jak vytvořit jednoduše aplikaci
APEX – jak vytvořit jednoduše aplikaciAPEX – jak vytvořit jednoduše aplikaci
APEX – jak vytvořit jednoduše aplikaciMarketingArrowECS_CZ
 
2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...
2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...
2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...Mohamedcpcbma
 
Oracle APEX 18.1 New Features
Oracle APEX 18.1 New FeaturesOracle APEX 18.1 New Features
Oracle APEX 18.1 New Featuresmsewtz
 
Oracle APEX 18.1 New Features
Oracle APEX 18.1 New FeaturesOracle APEX 18.1 New Features
Oracle APEX 18.1 New Featuresmsewtz
 
NYC School of Data - High School Selection Workshop
NYC School of Data - High School Selection WorkshopNYC School of Data - High School Selection Workshop
NYC School of Data - High School Selection Workshopmsewtz
 
Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio:  Fast and Easy Spatial Analytics and MapsOracle Spatial Studio:  Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio: Fast and Easy Spatial Analytics and MapsJean Ihm
 

Similaire à JavaScript Basics for APEX Developers (20)

Module 1: JavaScript Basics
Module 1: JavaScript BasicsModule 1: JavaScript Basics
Module 1: JavaScript Basics
 
Module 2: Adding JavaScript to APEX Apps
Module 2: Adding JavaScript to APEX AppsModule 2: Adding JavaScript to APEX Apps
Module 2: Adding JavaScript to APEX Apps
 
Dynamic Actions, the Hard Parts
Dynamic Actions, the Hard PartsDynamic Actions, the Hard Parts
Dynamic Actions, the Hard Parts
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
 
Intro to GraphQL for Database Developers
Intro to GraphQL for Database DevelopersIntro to GraphQL for Database Developers
Intro to GraphQL for Database Developers
 
How to add stuff to MySQL
How to add stuff to MySQLHow to add stuff to MySQL
How to add stuff to MySQL
 
Serverless patterns
Serverless patternsServerless patterns
Serverless patterns
 
Diagnose Your Microservices
Diagnose Your MicroservicesDiagnose Your Microservices
Diagnose Your Microservices
 
Apex atp customer_presentation_wwc march 2019
Apex atp customer_presentation_wwc march 2019Apex atp customer_presentation_wwc march 2019
Apex atp customer_presentation_wwc march 2019
 
APEX Office Hours Interactive Grid Deep Dive
APEX Office Hours Interactive Grid Deep DiveAPEX Office Hours Interactive Grid Deep Dive
APEX Office Hours Interactive Grid Deep Dive
 
Oracle APEX Introduction (release 18.1)
Oracle APEX Introduction (release 18.1)Oracle APEX Introduction (release 18.1)
Oracle APEX Introduction (release 18.1)
 
Oracle Application Express 20.2 New Features
Oracle Application Express 20.2 New FeaturesOracle Application Express 20.2 New Features
Oracle Application Express 20.2 New Features
 
EBS ECC Data Discovery and Visualization.pdf
EBS ECC Data Discovery and Visualization.pdfEBS ECC Data Discovery and Visualization.pdf
EBS ECC Data Discovery and Visualization.pdf
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015
 
APEX – jak vytvořit jednoduše aplikaci
APEX – jak vytvořit jednoduše aplikaciAPEX – jak vytvořit jednoduše aplikaci
APEX – jak vytvořit jednoduše aplikaci
 
2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...
2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...
2019 dev-marc sewtz-session-keynote-oracle_apex_19__neue_features_und_roadmap...
 
Oracle APEX 18.1 New Features
Oracle APEX 18.1 New FeaturesOracle APEX 18.1 New Features
Oracle APEX 18.1 New Features
 
Oracle APEX 18.1 New Features
Oracle APEX 18.1 New FeaturesOracle APEX 18.1 New Features
Oracle APEX 18.1 New Features
 
NYC School of Data - High School Selection Workshop
NYC School of Data - High School Selection WorkshopNYC School of Data - High School Selection Workshop
NYC School of Data - High School Selection Workshop
 
Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio:  Fast and Easy Spatial Analytics and MapsOracle Spatial Studio:  Fast and Easy Spatial Analytics and Maps
Oracle Spatial Studio: Fast and Easy Spatial Analytics and Maps
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

JavaScript Basics for APEX Developers

  • 1. Developer Advocate @ Oracle June 4, 2020 Dan McGhan for APEX Developers Intro to JavaScript
  • 2. Copyright © 2020, Oracle and/or its affiliates2 3 2 1 Working with the DOM and jQuery Adding JavaScript to APEX Apps JavaScript Basics Agenda Next Steps Q & A 4 5
  • 3. Copyright © 2020, Oracle and/or its affiliates3 Part 1: JavaScript Basics
  • 4. Copyright © 2020, Oracle and/or its affiliates4 5 4 3 2 1 Objects and functions Conditionals and loops Operators Variables and data types Why JavaScript? JavaScript Basics Developer tools6
  • 5. Copyright © 2020, Oracle and/or its affiliates5 5 4 3 2 1 Objects and functions Conditionals and loops Operators Variables and data types Why JavaScript? JavaScript Basics Developer tools6
  • 6. Copyright © 2020, Oracle and/or its affiliates6 If you're looking for a great APEX developer, you're really looking for a full-stack developer. https://joelkallman.blogspot.com/2017/10/a-great-apex-developer-isa-full-stack.html “ Joel Kallman, co-creator of APEX
  • 7. Copyright © 2020, Oracle and/or its affiliates7 Server-side Client-side Oracle Database Data Modeling SQL PL/SQL
  • 8. Copyright © 2020, Oracle and/or its affiliates8
  • 9. Copyright © 2020, Oracle and/or its affiliates9
  • 10. Copyright © 2020, Oracle and/or its affiliates10 Server-side Client-side Oracle Database Data Modeling SQL PL/SQL HTML CSS JavaScript
  • 11. Copyright © 2020, Oracle and/or its affiliates11 Your goal is not to be the master…
  • 12. Copyright © 2020, Oracle and/or its affiliates12 Your goal is not to be the master… It often takes just a few lines of JavaScript to deliver functionality not available out-of-the-box!
  • 13. Copyright © 2020, Oracle and/or its affiliates13 JavaScript • Designed to program the web • 3rd generation language - Based on Scheme, C++, and Java • Flexible/based on functions PL/SQL • Designed to extend SQL • 3rd generation language - Based on Ada • Procedural/block structured Languages at a glance
  • 14. Copyright © 2020, Oracle and/or its affiliates14 5 4 3 2 1 Objects and functions Conditionals and loops Operators Variables and data types Why JavaScript? JavaScript Basics Developer tools6
  • 15. Copyright © 2020, Oracle and/or its affiliates15 • Scope works by blocks - Nested blocks see outer scope • Declaration done in the declaration section • Strongly typed: specify name and data type - Data type will not change • Not case sensitive (by default) Declaring variables in PL/SQL
  • 16. Copyright © 2020, Oracle and/or its affiliates16 • Scope works by functions - Outside of functions = global scope - Nested blocks see outer scope • Declaration can be done anywhere - Best practice is to declare at top of function • Use var to declare a variable in a function - let and const aren’t well supported in IE 11 • Weakly typed: variables don’t have types - Values have types • Case sensitive (always) Declaring variables in JavaScript
  • 17. Copyright © 2020, Oracle and/or its affiliates17 • All SQL types • Plus many PL/SQL only types Common data types in PL/SQL Scalars NUMBER PLS_INTEGER CHAR VARCHAR2 BOOLEAN DATE TIMESTAMP TSWTZ TSWLTZ Large Objects CLOB BLOB Composites Records Collections Other NULL
  • 18. Copyright © 2020, Oracle and/or its affiliates18 Common data types in JavaScript Primitive type Object Undefined Null String Number Boolean Object Array Date Function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures
  • 19. Copyright © 2020, Oracle and/or its affiliates19 Common data types in JavaScript Primitive type Object Undefined Null String Number Boolean Object Array Date Function https://www.youtube.com/watch?v=wPBjd-vb9eI Uses IEEE 754 math .1 + .2 = 0.30000000000000004
  • 20. Copyright © 2020, Oracle and/or its affiliates20 • Literal - Simpler than a constructor function - Supported by all primitives and basic objects - Date not supported • Constructor function - Uses new keyword with constructor function - Use when object literal not available Two syntaxes for creating new objects
  • 21. Copyright © 2020, Oracle and/or its affiliates21 5 4 3 2 1 Objects and functions Conditionals and loops Operators Variables and data types Why JavaScript? JavaScript Basics Developer tools6
  • 22. Copyright © 2020, Oracle and/or its affiliates22 Using “objects” - PL/SQL vs. JavaScript
  • 23. Copyright © 2020, Oracle and/or its affiliates23 Using “objects” - PL/SQL vs. JavaScript https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics
  • 24. Copyright © 2020, Oracle and/or its affiliates24 Functions overview PL/SQL JavaScript Functions Yes (must return a value) Yes (optionally return a value) Procedures Yes (does not return a value) No (use a function with no return value) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions
  • 25. Copyright © 2020, Oracle and/or its affiliates25 Creating functions in JavaScript Function statement
  • 26. Copyright © 2020, Oracle and/or its affiliates26 Creating functions in JavaScript Function statement Function expression
  • 27. Copyright © 2020, Oracle and/or its affiliates27 Using functions - PL/SQL vs. JavaScript
  • 28. Copyright © 2020, Oracle and/or its affiliates28 Using functions - PL/SQL vs. JavaScript
  • 29. Copyright © 2020, Oracle and/or its affiliates29 • Functions are a lot like other data types (numbers, strings, etc.) • Can be assigned to variables and passed around as parameters • Can be returned from other functions Functions are 1st class in JavaScript
  • 30. Copyright © 2020, Oracle and/or its affiliates30 JavaScript objects/functions in browsers Object Description window THE “global” object. Represents the browser window. (think SYS schema) document API to the document/web page. We’ll cover this later. console API for debug output. (think dbms_output) JSON Object that provides tools for working with JSON, e.g. JSON.parse & JSON.stringify. setTimeout Function to schedule work for the future (think dbms_scheduler) setInterval Function to schedule recurring work (think dbms_scheduler) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference#Global_Objects
  • 31. Copyright © 2020, Oracle and/or its affiliates31 Pop quiz! Which of the following will not throw an exception? A B C
  • 32. Copyright © 2020, Oracle and/or its affiliates32 5 4 3 2 1 Objects and functions Conditionals and loops Operators Variables and data types Why JavaScript? JavaScript Basics Developer tools6
  • 33. Copyright © 2020, Oracle and/or its affiliates33 Developer tools for PL/SQL
  • 34. Copyright © 2020, Oracle and/or its affiliates34 Developer tools for PL/SQL https://developers.google.com/web/tools/chrome-devtools
  • 35. Copyright © 2020, Oracle and/or its affiliates35 Part 2: Adding JavaScript to APEX Apps
  • 36. Copyright © 2020, Oracle and/or its affiliates36 4 3 2 1 Static files Page and component level attributes Dynamic Actions with JavaScript hooks Dynamic Actions Adding JavaScript to APEX Apps
  • 37. Copyright © 2020, Oracle and/or its affiliates37 4 3 2 1 Static files Page and component level attributes Dynamic Actions with JavaScript hooks Dynamic Actions Adding JavaScript to APEX Apps
  • 38. Copyright © 2020, Oracle and/or its affiliates38 • A declarative way to add dynamic behaviors to a page - Configure attributes to specify what happens and when - APEX generates the JavaScript and adds it to the page • Two parts - Dynamic Action: the event and related component - Actions: the response, such as ‘hide’ or ‘show’ What are Dynamic Actions?
  • 39. Copyright © 2020, Oracle and/or its affiliates39 Thinking through Dynamic Actions Action Event
  • 40. Copyright © 2020, Oracle and/or its affiliates40 Thinking through Dynamic Actions Action Event Action Action
  • 41. Copyright © 2020, Oracle and/or its affiliates41 Thinking through Dynamic Actions Actions Dynamic Action Action Event Action Action
  • 42. Copyright © 2020, Oracle and/or its affiliates42 Thinking through Dynamic Actions Actions Dynamic Action ActionAction ConditionEvent False True
  • 43. Copyright © 2020, Oracle and/or its affiliates43 Thinking through Dynamic Actions Actions Dynamic Action ActionAction ConditionEvent False True Action Action Action Action
  • 44. Copyright © 2020, Oracle and/or its affiliates44 Thinking through Dynamic Actions Actions Dynamic Action ActionAction ConditionEvent False True Action Action Action Action Many actions can be configured to fire at page load too.
  • 45. Copyright © 2020, Oracle and/or its affiliates45 • Disable Alternate Number field until the Phone Number is populated Example 1
  • 46. Copyright © 2020, Oracle and/or its affiliates46 • Disable Alternate Number field until the Phone Number is populated Example 1 • What’s the driver? • Is there a condition? • What are the true/false actions? • Relevant at page load too?
  • 47. Copyright © 2020, Oracle and/or its affiliates47 • Disable Alternate Number field until the Phone Number is populated Example 1 Actions Dynamic Action Disable Alt. PhoneEnable Alt. Phone Value is nullPhone Num. changes False True + PL + PL
  • 48. Copyright © 2020, Oracle and/or its affiliates48 4 3 2 1 Static files Page and component level attributes Dynamic Actions with JavaScript hooks Dynamic Actions Adding JavaScript to APEX Apps
  • 49. Copyright © 2020, Oracle and/or its affiliates49 • Dynamic Actions can’t cover everything - Hooks are provided to extend capabilities - Requires basic knowledge of JavaScript to use • Probably the sweet spot for most APEX developers Dynamic Actions with JavaScript hooks
  • 50. Copyright © 2020, Oracle and/or its affiliates50 • Custom Event option accepts any event name • jQuery Selector provides a flexible means of selecting elements Dynamic Action: Event and Selection Type Action Dynamic Action
  • 51. Copyright © 2020, Oracle and/or its affiliates51 • Declarative conditions only work with one item’s value • The JavaScript Expression option provides full access to the DOM - Must resolve to true or false - See the “help” for additional options Dynamic Action: Client-side Condition Action Dynamic Action
  • 52. Copyright © 2020, Oracle and/or its affiliates52 • Declarative options are great for common interactions - Hide/show, enable/disable, refresh, etc. • Execute JavaScript can do anything not available out of the box Action: Execute JavaScript Action Dynamic Action
  • 53. Copyright © 2020, Oracle and/or its affiliates53 Part 3: Working with the DOM and jQuery
  • 54. Copyright © 2020, Oracle and/or its affiliates54 5 4 3 2 1 Creating event listeners Events overview Selecting, traversing, and manipulating the DOM What is jQuery? Understanding the DOM Working with the DOM and jQuery
  • 55. Copyright © 2020, Oracle and/or its affiliates55 5 4 3 2 1 Creating event listeners Events overview Selecting, traversing, and manipulating the DOM What is jQuery? Understanding the DOM Working with the DOM and jQuery
  • 56. Copyright © 2020, Oracle and/or its affiliates56 • Hypertext Markup Language (HTML) - Markup language that browsers understand to render web pages • Document Object Model (DOM) - In memory object representation of the HTML document (DOM tree) - API for working with and manipulating the memory structure HTML vs. DOM
  • 57. Copyright © 2020, Oracle and/or its affiliates57 HTML document http://www.html5rocks.com/en/tutorials/internals/howbrowserswork
  • 58. Copyright © 2020, Oracle and/or its affiliates58 DOM Tree http://www.html5rocks.com/en/tutorials/internals/howbrowserswork
  • 59. Copyright © 2020, Oracle and/or its affiliates59 • The DOM is not a part of JavaScript (the language) • The DOM is one of many “Web APIs” - Web APIs make JavaScript useful in a browser - The DOM API is made available via window.document in browsers The DOM in JavaScript JS + Web APIs Endless Possibilities! 😃 =
  • 60. Copyright © 2020, Oracle and/or its affiliates60 5 4 3 2 1 Creating event listeners Events overview Selecting, traversing, and manipulating the DOM What is jQuery? Understanding the DOM Working with the DOM and jQuery
  • 61. Copyright © 2020, Oracle and/or its affiliates61 • Early DOM APIs were not so good - Very difficult to use - Browsers were inconsistent • jQuery solved the problem - First released in 2006, when the DOM APIs were still a mess - jQuery provided simple APIs that worked on all major browsers • Today, the DOM APIs are improving - Check out http://youmightnotneedjquery.com - However, jQuery will be in APEX for the foreseeable future DOM problems
  • 62. Copyright © 2020, Oracle and/or its affiliates62 • Step 1: Include the library in the web page - Already included with APEX - Adds a function named jQuery in the global scope - The shortcut $ is more common (also apex.jQuery in APEX) • Step 2: Select something - You invoke the jQuery function passing in a “selector” or “query” - jQuery returns a jQuery object (wraps selected elements) • Step 3: Do something with what you selected - DOM manipulation, traversal, events, effects, etc. Using jQuery
  • 63. Copyright © 2020, Oracle and/or its affiliates63 5 4 3 2 1 Creating event listeners Events overview Selecting, traversing, and manipulating the DOM What is jQuery? Understanding the DOM Working with the DOM and jQuery
  • 64. Copyright © 2020, Oracle and/or its affiliates64 Basic selectors Description Syntax Example ID Selector '#id' $('#message') Class Selector '.class' $('.boring') Element Selector 'element' $('ul') Multiple Selector 'sel1, sel2, selN' $('.fun, #message') http://api.jquery.com/category/selectors/
  • 65. Copyright © 2020, Oracle and/or its affiliates65 • DOM APIs return DOM elements • jQuery APIs return a jQuery object - Wraps the DOM elements selected • jQuery objects have their own methods - Often still easier to use than DOM APIs - jQuery methods are often chainable • Access to elements is provided if needed - Use [] or get DOM elements vs. jQuery objects
  • 66. Copyright © 2020, Oracle and/or its affiliates66 Example web page https://en.wikipedia.org/wiki/Paul_Ekman
  • 67. Copyright © 2020, Oracle and/or its affiliates67 Example web page HTML ID Class Element <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 68. Copyright © 2020, Oracle and/or its affiliates68 Selection ID Class Element $("#question") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 69. Copyright © 2020, Oracle and/or its affiliates69 Selection ID Class Element $("#emotions-list") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 70. Copyright © 2020, Oracle and/or its affiliates70 Selection Element ID Class $(".positive") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 71. Copyright © 2020, Oracle and/or its affiliates71 Selection Element ID Class $(".negative") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 72. Copyright © 2020, Oracle and/or its affiliates72 Selection ID Class Element $("div") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 73. Copyright © 2020, Oracle and/or its affiliates73 Selection ID Class Element $("input") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 74. Copyright © 2020, Oracle and/or its affiliates74 Simple traversing Description Example functions Example Parents parent, parents, closest $('li.done').parent(); Children children, find $('ul').find('li'); Siblings siblings, next, prev $('li.pending').next(); Filtering eq, filter, first, last $('li').eq(1); http://api.jquery.com/category/traversing/
  • 75. Traversal $("#question") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div> Copyright © 2020, Oracle and/or its affiliates75
  • 76. Traversal Copyright © 2020, Oracle and/or its affiliates76 $("#question").parent() <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 77. Traversal Copyright © 2020, Oracle and/or its affiliates77 $("#question").parent().find("li") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 78. Traversal Copyright © 2020, Oracle and/or its affiliates78 $("#question").parent().find("li").eq(2) <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 79. Copyright © 2020, Oracle and/or its affiliates79 Simple DOM manipulation Description Example functions Example Add/remove classes addClass, removeClass, toggleClass $('li.done') .removeClass('done') .addClass('pending'); Modify attributes attr, removeAttr, prop, removeProp, val $('input') .attr('disabled', 'disabled'); DOM insertion html, text, append, prepend $('ul') .append('<li>Hello</li>'); DOM removal remove, empty $('ul').empty(); Change CSS styles css $('h1').css('color', 'red'); http://api.jquery.com/category/manipulation/
  • 80. Manipulation Copyright © 2020, Oracle and/or its affiliates80 $(".neutral") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 81. Manipulation Copyright © 2020, Oracle and/or its affiliates81 $(".neutral").addClass("positive") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral positive">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 82. Manipulation Copyright © 2020, Oracle and/or its affiliates82 $(".neutral").addClass("positive").removeClass("neutral") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="positive">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 83. Manipulation Copyright © 2020, Oracle and/or its affiliates83 $("input[type='text']") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="positive">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 84. Manipulation Copyright © 2020, Oracle and/or its affiliates84 $("input[type='text']").attr("disabled", "disabled") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="positive">Surprised</li> </ul> </div> <input type="text" name="feeling" disabled="disabled"> <input type="button" value="Submit"> </div>
  • 85. Manipulation Copyright © 2020, Oracle and/or its affiliates85 $("#question") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 86. Manipulation Copyright © 2020, Oracle and/or its affiliates86 $("#question").text("How do you feel?") <div class="question-wrapper"> <div><h1 id="question">How do you feel?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 87. Manipulation Copyright © 2020, Oracle and/or its affiliates87 $("#emotions-list") <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 88. Manipulation Copyright © 2020, Oracle and/or its affiliates88 $("#emotions-list").append('<li class="positive">Amusement</li>') <div class="question-wrapper"> <div><h1 id="question">How are you feeling?</h1> <div>Here are the six basic emotions:</div> <ul id="emotions-list"> <li class="positive">Happy</li> <li class="negative">Sad</li> <li class="negative">Fearful</li> <li class="negative">Disgusted</li> <li class="negative">Angry</li> <li class="neutral">Surprised</li> <li class="positive">Amusement</li> </ul> </div> <input type="text" name="feeling"> <input type="button" value="Submit"> </div>
  • 89. Copyright © 2020, Oracle and/or its affiliates89 Part 4: Next Steps
  • 90. Copyright © 2020, Oracle and/or its affiliates90 https://asktom.oracle.com/pls/apex/asktom.search?oh=8561
  • 91. Copyright © 2020, Oracle and/or its affiliates91 https://www.qualogy.com/discover-qualogy/news-blogs/news-blog/meet-the-oracle-masters-the-online-series
  • 92. Copyright © 2020, Oracle and/or its affiliates92 https://bit.ly/intro2js4apex https://bit.ly/js-con-apex
  • 93. • Current - https://apex.oracle.com/jsapi • APEX 20.1 - https://docs.oracle.com/en/database/oracle/application-express/20.1/aexjs/index.html • APEX 19.2 - https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/index.html • APEX 19.1 - https://docs.oracle.com/en/database/oracle/application-express/19.1/aexjs/index.html • APEX 18.2 - https://docs.oracle.com/en/database/oracle/application-express/18.2/aexjs/toc.html • APEX 18.1 - https://docs.oracle.com/database/apex-18.1/AEXJS/index.html • APEX 5.1 - https://docs.oracle.com/database/apex-5.1/AEAPI/JavaScript-APIs.htm#AEAPI266 APEX JavaScript APIs
  • 94. • JavaScript Path - https://www.pluralsight.com/paths/javascript • JavaScript Fundamentals for ES6 - https://www.pluralsight.com/courses/javascript-fundamentals-es6 • Rapid ES6 Training - https://www.pluralsight.com/courses/rapid-es6-training Pluralsight Paths and Courses on JavaScript
  • 95. • JavaScript for impatient programmers (HTML version is free) - https://exploringjs.com/impatient-js/ • You Don’t Know JS (Github book, free) - https://github.com/getify/You-Dont-Know-JS • Eloquent JavaScript - https://www.amazon.com/dp/1593279507 • HTML, CSS, and JavaScript All in One - https://www.amazon.com/dp/0672338084 Books on JavaScript
  • 96. • Online Tutorial: Code Academy - https://www.codecademy.com/learn/learn-jquery • Book: A Smarter Way to Learn jQuery - http://a.co/e9Jzxnx • API Doc - http://api.jquery.com/ jQuery specific resources
  • 97. • Fun Fun Function - https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q • Lean JavaScript – Full Course for Beginners - https://www.youtube.com/watch?v=PkZNo7MFNFg JavaScript content on YouTube
  • 98. Copyright © 2020, Oracle and/or its affiliates98 Part 5: Q & A
  • 99. Copyright © 2020, Oracle and/or its affiliates99 Any questions? Follow me on Twitter twitter.com/dmcghan Join me here