Mobile
AJAX & Widgets

Parke Godfrey
16 November 2012
CSE-2041

Credits

These slides are based in part on ones from the following sources.

Dynamic Pages II


But...what if our webapp needs additional information from a server? Or additional components for the webapp?

We don't want to rebuild / refresh the entire page (CGI).

Examples
of needing more information or components

Any way to do this?!



This was the situation in 2005. And there did not seem any obvious, universal way to do this.

Until...

History
well, okay...

The Web community was aware of this issue for a long time. And techniques were invented / introduced.

Surprisingly, mostly by Microsoft!


But these were not standard, and a number of these only worked with IE.

AJAX


  • AJAX was a total hack, in a way. Came about in 2004–2006 from techniques used in Google pages.

  • Named in 2005.

  • Standardized by W3C in 2006: XMLHttpRequest.

The Interchange
What's the format for the payload back?

Why Asynchronous?


We don't want our webapp to be frozen between the time of making a request and receiving the response.



Webapps
So, how to fetch without “going to” a new page then?

Web Apps vs Native Apps
What are we missing?

Local Storage

Local Storage (2)

Local Storage (3)



Would storing in the DOM be a good idea?

Push vs Pull

Polling
when you just don't have push

Widgets
W3C's name for standalone webapps