Devleague 5/20 -5/30
Learning about HTTP requests…
http: hyper text transfer protocol
ftp: file transfer protocol
smtp: secure mail transfer protocol
http requests:
GET: retrieve source
POST: create resource
PUT: update resource
DELETE: delete source
API: Application Programming Interface
Some cool ‘number’ methods…
Math.pow(base, exponent)
-returns the base to the exponential power
example:
Math.pow(2, 3) => 8
Math.max([value1[, value2[, …]]])
-returns the largest of zero or more numbers
example:
Math.max(1, 6, 19, 3) => 19
toFixed(digits)
-convert a number into a string
-keeps x number of digits after the decimal point
-rounds the number
example:
var num = 5.56789;
var n = num.toFixed(2);
The result of n will be: 5.57
a String Method
trim()
removes empty spaces from the beginning and end of a string
example:
var str= ‘ pillow ‘
str.trim() => ‘pillow’
Other methods
append()
-add content at end of element
prepend()
-adds elements at beginning of element
jQuery
We got to learn a bit of jQuery methods. I’m actually starting to like it. It helps to simplify certain methods. For instance…
$
-acts as a window.onload function
-can create element functions
-can select elements