Difference between revisions of "Week Thirteen (MGDP2060)"
Karl Jones (Talk | contribs) |
Karl Jones (Talk | contribs) |
||
Line 32: | Line 32: | ||
In a [[web browser]], the [[Document Object Model]] (DOM) represents the [[HTML]], [[Cascading Style Sheets|CSS]], and other parts of a web page. | In a [[web browser]], the [[Document Object Model]] (DOM) represents the [[HTML]], [[Cascading Style Sheets|CSS]], and other parts of a web page. | ||
+ | |||
+ | == Web service == | ||
+ | |||
+ | == Web feed == | ||
+ | |||
+ | == CORS == | ||
+ | |||
+ | == WordPress to override CORS == | ||
+ | |||
+ | Add this code to <code>functions.php</code>: | ||
+ | |||
+ | <pre> | ||
+ | add_action( 'pre_get_posts', 'add_header_origin' ); | ||
+ | |||
+ | function add_header_origin() { | ||
+ | if (is_feed()){ | ||
+ | header( 'Access-Control-Allow-Origin: *' ); | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
== Exercises == | == Exercises == |
Revision as of 20:20, 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)
Contents
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.
JSON
JSON is a file format for text data, widely used in web applications.
JSON is an alternative to XML.
JSON file
A JSON file is a text file containing JSON data (and nothing else).
JSON files have the .json file extension.
JSON data is commonly delivered via web service, and not as a text file.
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
Web feed
CORS
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: *' ); } }