Difference between revisions of "Week Thirteen (MGDP2060)"
Karl Jones (Talk | contribs) (→Asynchronous example) |
Karl Jones (Talk | contribs) (→RSS) |
||
Line 79: | Line 79: | ||
== RSS == | == RSS == | ||
− | RSS (Rich Site Summary); originally RDF Site Summary; often called Really Simple Syndication, uses a family of standard [[web feed]] formats to publish frequently updated information. | + | [[RSS]] (Rich Site Summary); originally RDF Site Summary; often called Really Simple Syndication, uses a family of standard [[web feed]] formats to publish frequently updated information. |
== Application programming Interface (API) == | == Application programming Interface (API) == |
Revision as of 10:46, 1 December 2016
This article lists topics for Week Thirteen of Web Design and Development III (MGDP2060).
Previous: Week Twelve (MGDP2060) - Next: Week Fourteen (MGDP2060)
Contents
Course survey
Please fill out the course survey:
https://www.surveymonkey.com/r/FQ5DK9G
Ajax
Ajax is a programming paradigm, widely used in web design and development.
Ajax is a number of things, the most important being the fact that JavaScript can:
- Send requests from a browser
- Receive responses from the server
- Update the browser's Document Object Model -- in other words, what the user sees (or hears) in the browser.
"Ajax" stands for "Asynchronous JavaScript and XML". This is sometimes descriptive, but not always: Ajax does not need to be asynchronous, nor does it need to use JavaScript or XML.
In practice, Ajax usually is asynchronous, and does use JavaScript, although JSON often takes the place of XML.
Asynchronous
The word 'asynchronous', or 'async' for short, means 'takes some time' or 'happens in the future, not right now'.
Synchronous example
- Waiter takes order from table A.
- Waiter delivers order to kitchen.
- Waiter delivers food to table A.
- Waiter takes order from table B.
- Waiter delivers order to kitchen.
- Waiter delivers food to table B.
Asynchronous example
- Waiter takes order from table A.
- If table B is ready, waiter takes order from table B.
- Waiter delivers order from table A to kitchen.
- If table B is ready, waiter takes order from table B.
- If food for table A is ready, waiter delivers food to table A.
- If table B is ready, waiter takes order from table B.
- If food for table A is ready, waiter delivers food to table A.
- If table B is ready, waiter takes order from table B.
- Waiter delivers order from table B to kitchen.
- If food for table B is ready, waiter delivers food to table B.
See Asynchronous I/O.
XML
Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable.
It is used for many purposes, including RSS.
JSON
JSON is a file format for text data, widely used in web applications.
JSON is an alternative to XML.
Document Object Model
In a web browser, the Document Object Model (DOM) represents the HTML, CSS, and other parts of a web page.
Web service
A web service is a method of communication between two electronic devices over a computer network.
It is a software function provided at a network address over the World Wide Web, with the service always on, as in the concept of utility computing.
Web feed
On the World Wide Web, a web feed (news feed, syndicated feed, etc.) is a data format used for providing users with frequently updated content.
RSS
RSS (Rich Site Summary); originally RDF Site Summary; often called Really Simple Syndication, uses a family of standard web feed formats to publish frequently updated information.
Application programming Interface (API)
An application programming interface (API) is a set of routines, protocols, and tools for building application software.
APIs are widely used on the web as web services or web feeds. Some can be used for free; others are free, but require a key; yet others require payment and a key.
Public APIs
- Loripsum.net
- Church Calendar API
- Random word API
- Recipe Puppy
- Foreign exchange rates and currency conversion
- Deck of cards API
- Quotes on Design
- Sunset and sunrise times API
Lists of public APIs
- Public APIs compiled by Todd Motto
- List of open APIs @ Wikipedia
- Search the Largest API Directory on the Web
- Explore The Largest API Directory In The Galaxy
- Any API
- 50 Most Useful APIs for Developers
- Data.gov APIs
Cross-origin resource sharing (CORS)
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.
WordPress to override CORS
Add this code to functions.php
:
add_action( 'pre_get_posts', 'add_header_origin' ); function add_header_origin() { if (is_feed()){ header( 'Access-Control-Allow-Origin: *' ); } }
WordPress RSS2 feed for specific category
RSS feed URL for category 7 ("Chairs"):
http://mgdp2060.x10host.com/?feed=rss2&cat=7
Resolves to:
http://mgdp2060.x10host.com/category/chairs/feed/