UMass Lowell Dept. of Computer Science

91.461 GUI Programming I

Fall 2015 Semester, Section 201

Prof. Jesse M. Heines

Notes for Class No. 12

Introduction to JavaScript and Introduction to Forms (continued)

Thursday, October 8, 2015

A video of this class is (or will be) posted at:   http://echo360.uml.edu/heines201516/guiprogramming1.html


Handouts and Materials


Openings / Announcements / Reminders

Remember:  We do not have class next Tuesday, as that is a Monday class schedule

Please complete the Midterm Course Evaluation

https://docs.google.com/forms/d/1dHTYaWtph67108xNBn2XA5ezyr3XdrqoGjWep86Nxgk/viewform


Class Notes

Related reading for this class:  JS&jQ:TMM Ch. 1-3


A Whirlwind Look at JavaScript  (continued)

Functions

Function declarations vs. function expressions

Key concept:  FUNCTIONS ARE SIMPLY EXECUTABLE VARIABLES

Run all of the above functions


Functions as First-Class Objects  (Stefanov, Ch. 4)


Using Forms with Assignment No. 6

Creating Forms


Processing Form Data with JavaScript

Working with the location object

http://jesseheines.com/~heines/91.461/91.461-2015-16f/461-lecs/lecture12.jsp?one=1&two=2&three=3

  1. location.search
  2. location.search.substr(1)
  3. location.search.substr(1).split("&")
  4. location.search.substr(1).split("&").length
  5. location.search.substr(1).split("&")[0].split("=")
  6. location.search.substr(1).split("&")[1].split("=")
  7. location.search.substr(1).split("&")[0].split("=")[0]
  8. location.search.substr(1).split("&")[0].split("=")[1]
  9. obj = {} ;
  10. obj
  11. obj[location.search.substr(1).split("&")[0].split("=")[0]] = location.search.substr(1).split("&")[0].split("=")[1]
  12. obj
    • Object{ one = "1" }

Demonstration

Input

http://jesseheines.com/~heines/91.461/91.461-2015-16f/461-lecs/lecture12.jsp?one=1&three=3&two=2

Output

Live Demo



This is document http://jesseheines.com:8080/~heines/91.461/91.461-2015-16f/461-lecs/lecture12.jsp.  It was last modified on Friday, August 26, 2022 at 4:09 PM.
Copyright © 2022 by Jesse M. Heines.  All rights reserved.  May be freely copied or excerpted for educational purposes with credit to the author.