WDD 330 portfolio
Week 07
Notes
- AJAX is a set of web development techniques using many web technologies on the client-side to create
asynchronous web applications.
- NEVER FORGET TO SINCRONIZE CHANGES TO GITHUB!!!!
- Ajax is not a single technology, but rather a group of technologies.
-
Sometimes async = false are used for quick testing.
- Functions are one of the fundamental building blocks in JavaScript. A function in JavaScript is similar
to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to
qualify as a function, it should take some input and return an output where there is some obvious
relationship between the input and the output. To use a function, you must define it somewhere in the
scope from which you wish to call it
Questions
-
Is AJAX the same as Javascript?
Code Examples
-
/ Initialize the HTTP request.
var xhr = new XMLHttpRequest();
xhr.open('GET', 'send-ajax-data.php');
-
Function Example:
function myFunc(theObject) {
theObject.make = 'Toyota';
}
var mycar = {make: 'Honda', model: 'Accord', year: 1998};
var x, y;
x = mycar.make; // x gets the value "Honda"
myFunc(mycar);
y = mycar.make; // y gets the value "Toyota"
// (the make property was changed by the function)