WebFund 2015W Lecture 15

From Soma-notes
Revision as of 14:38, 4 March 2015 by Soma (talk | contribs) (Created page with "==Video== The video from the lecture given on March 4, 2015 [http://homeostasis.scs.carleton.ca/~soma/webfund-2015w/lectures/comp2406-2015w-lec15-04Mar2015.mp4 is now availab...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Video

The video from the lecture given on March 4, 2015 is now available.

Code

persistent-notes/public/javascripts/notes.js

$(function() {
    $.getJSON("/testdata", function(data) {
        $("#otheruser").text("Or is it " + data.username + "?");
    });
});


Notes

From Lecture:

AJAX
----

Asynchronous JavaScript And XML

more AJAJ (XML => JSON)

Old JavaScript just ran in response to local events
 - timer
 - mouse, keyboard
 - on page load

AJAX allows background processing, particularly of network communication
 - do GETs and POSTs in the background

Allows for "single page" web apps

XMLHttpRequest - originally an ActiveX object
 - now native
 - written by Microsoft for Outlook Web Access

jQuery provides nicer interfaces to XMLHttpRequest
* $.getJSON()
* $.post()

Arguments:
 - URL (path on the server)
 - callback