Difference between revisions of "Week Thirteen (MGDP2060)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(XML)
Line 18: Line 18:
  
 
[[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.
 
[[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 ==

Revision as of 22:08, 28 November 2016

This article lists topics for Week Thirteen of Web Design and Development III (MGDP2060).

Previous: Week Twelve (MGDP2060) - Next: Week Fourteen (MGDP2060)

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 happens without the user browsing from page to page, handled automatically by JavaScript.

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.

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=y

Resolves to:

http://mgdp2060.x10host.com/category/chairs/feed/

Exercises

See Week Thirteen Exercises (MGDP2060).