SLIDE 1 Widgets and JavaScr cript
COMS 4170 19 February 2018 No screens
Say your name
SLIDE 2 Goal 1
Build websites that suit the needs and abilities of users
To accomplish a goal, users must execute an operation and evaluate the result To execute an operation users must interact with elements on the page
SLIDE 3
There are some standard ways we interact with elements in an interface:
SLIDE 4
There are some standard ways we interact with elements in an interface:
SLIDE 5
Buttons and Text Inputs are examples of widgets.
SLIDE 6
HTML JavaScript
Remember the JQuery Button Counter?
SLIDE 7 Widgets standardized low-level interaction interfaces
The appearance is standardized, The types of events it responds to are standardized When you create a widget… But the actions taken after an event is fired, are not standardized
SLIDE 8 Widgets
Basic elements for users to interact with your UI
SLIDE 9
Button Widget interaction: What event fires?
“Click event”
SLIDE 10
“Keypress” event
Text Input interaction: What event fires?
SLIDE 11
“Change” event
Radio Input interaction: What event fires?
SLIDE 12
“Change” event
<select> interaction: What event fires?
SLIDE 13
- “Search” event
- “Select” event
Autocomplete interaction: What event fires?
SLIDE 14
- “Drag” event
- “Drop” event
Drag and Drop interaction: What event fires?
SLIDE 15 Widgets standardized low-level interaction interfaces
The appearance is standardized, The types of events it responds to are standardized When you create a widget… But the actions taken after an event is fired, are not standardized “Click” “Keypress” “Search” “Change”
SLIDE 16
Creating Widgets Dynamically
SLIDE 17 HTML JavaScript
St Statically created widget: cr created o
page l load.
SLIDE 18 HTML JavaScript
Dy Dynam amic ically ally created widget: cr created o
demand b based o
user i interact ction.
Create a new button when I am clicked! Click me And me! And me! And me! And me! And me! And me!
SLIDE 19 HTML JavaScript
Whe Where in n the he code de sho shoul uld d we add dd the he dyna dynamic beha behavi vior?
Create a new button when I am clicked! Click me And me! And me! And me! And me! And me! And me!
SLIDE 20
HTML JavaScript
How did we create the button in JavaScript?
SLIDE 21
HTML JavaScript
Add widget to UI dynamically
SLIDE 22
HTML JavaScript
Where do we create a lin
line e break eak dy dynam namical ally?
SLIDE 23
HTML JavaScript
How do we create a lin
line e break eak dy dynam namical ally?
SLIDE 24
HTML JavaScript
Wh Where do we create a bo boots tstr trap but p button n dynam dynamical ally?
SLIDE 25
HTML JavaScript
Ho How do we create a bo bootstrap p but button n dy dynam namical ally?
SLIDE 26
HTML JavaScript
Whe Where do we create a cl click ck e event dy dynam namical ally?
SLIDE 27
HTML JavaScript
Ho How do we create a cl click ck e event dy dynam namical ally?
SLIDE 28
Static: HTML, JavaScript onReady Dynamic: All JavaScript
You can create elements st
statically in HTML
Or dy
dyna namically in JavaScript (JQuery)
SLIDE 29
Pros and Cons of Standardization
SLIDE 30
What’s go
good about standardization?
Standardized Non-Standardized
SLIDE 31
What’s ba
bad d about standardization?
Standardized Non-Standardized
SLIDE 32
Things that have moved toward standardization
SLIDE 33 Widgets allow customization
Customizable scroll bars Bad use of customization. Good use of customization.
SLIDE 34
Use your powers of customization wisely.
SLIDE 35
Summary
SLIDE 36
There are some standard ways we interact with elements in an interface:
SLIDE 37 Widgets standardize common, low-level interaction interfaces
The appearance is standardized, The types of events it responds to are standardized When you create a widget… But the actions taken after an event is fired, are not standardized
SLIDE 38
Static: HTML, JavaScript onReady Dynamic: All JavaScript
You can create elements st
statically in HTML
Or dy
dyna namically in JavaScript (JQuery)
SLIDE 39 Widgets allow customization. Use it wisely.
Customizable scroll bars Bad use of customization. Good use of customization.