Week Ten (MGDP2050)
Week Ten of Web Design and Development II (MGDP2050).
See also Week Nine (MGDP2050) - Week Eleven (MGDP2050).
Contents
- 1 Project
- 2 Lecture notes
- 3 Exercises: in class
- 3.1 Catch up previous exercises
- 3.2 Goal
- 3.3 Create week10 folder and web pages
- 3.4 Add content for Backbone.js
- 3.5 Save local copies of Underscore.js and Backbone.js
- 3.6 Add script elements for Underscore.js and Backbone.js
- 3.7 Create a custom JavaScript file
- 3.8 Add script element for custom JavaScript file
- 3.9 Create a JSON file, and change the data
- 3.10 Upload work to server, and test
- 3.11 Make link from Home page to exercise page
- 3.12 Update your home page
Project
Your semester project website can use whatever technologies you need to meet your own goals.
The project does not need to include everything from the weekly exercises.
- The weekly exercises are designed to introduce students to a wide range of topics, only some of which will be relevant to your project.
For example, you probably don't want to use Backbone.js for your project:
- A website that uses Backbone.js is built entirely around Backbone (thus the name).
- Learning Backbone.js would take too much time -- an entire semester.
Similarly, don't use jQuery unless you really need jQuery.
The only technology (beyond HTML and CSS) to which we are committed is Bootstrap, because it is widely used for responsive web design.
Lecture notes
See Week Ten lecture notes (MGDP2050).
Exercises: in class
Catch up previous exercises
Catch up on your exercises from previous weeks.
Goal
Create a web page which demonstrates Backbone.js and Ajax, similar to this example page.
Create week10 folder and web pages
Create a new folder named week10, and a new web page named index.html, with the usual exercise styles, title, etc.
Add content for Backbone.js
Add content for Backbone.js. You can use View Source and copy the code from the example page, or copy the code below:
<script type="text/template" id="itemlist_template"> <li><%= item_name %></li> </script> <ol id="items"> </ol>
Save local copies of Underscore.js and Backbone.js
Add script elements for Underscore.js and Backbone.js
You can use View Source and copy the code from the example page, or copy the code below:
Create a custom JavaScript file
You can use View Source and copy the code from the example page, or copy the code below:
Add script element for custom JavaScript file
Add a script element for your custom JavaScript.
You can use View Source and copy the code from the example page, or copy the code below:
Create a JSON file, and change the data
Create a JSON file named data.json, similar to this example:
Save the JSON file in your week10 folder.
Change the item names ("Solid Gold Submarine", etc.) to names of your choice, related to your project topic.
Upload work to server, and test
Note that you must test this exercise online -- it will not work locally.
Make link from Home page to exercise page
Make link from Home page to exercise page.
Upload your Home page, and test the link to your exercise.
Update your home page
On your Home page, make a link to this exercise.