Week Thirteen Exercises (MGDP2060)

From Wiki @ Karl Jones dot com
Revision as of 16:59, 1 December 2016 by Karl Jones (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article contains exercises for Week Thirteen of Web Design and Development III (MGDP2060).

Ajax

Create a folder named ajax on your exercise web server.

Create a document named index.html.

Enter HTML and JavaScript which retrieves RSS data and displays the data, similar to this example:

http://code.karljones.com/ajax/wordpress-rss-ajax-2.html

Modify the code so it displays one of your product lines.

Browse the page, and confirm that it displays the items in your product line.

Add a product to that line. Browse again, to confirm that the new product displays.

WordPress CORS

Add this code to the functions.php file in your WordPress exercise installation:

add_action( 'pre_get_posts', 'add_header_origin' );

function add_header_origin() {
    if (is_feed()){
        header( 'Access-Control-Allow-Origin: *' );
    }
} 

This is so other users (the instructor, in this case) can access your RSS feed.

Project

• Work on your project.