Difference between revisions of "Week Nine (MGDP2050)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
Line 29: Line 29:
 
* Use your standard Bootstrap exercise layout and CSS
 
* Use your standard Bootstrap exercise layout and CSS
 
* Set the page title appropriately
 
* Set the page title appropriately
 +
 +
=== underscore.js ===
 +
 +
Underscore.js is a [[JavaScript library]].  This library is required by Backbone.
 +
 +
Add a script element to your web page, like this:
 +
 +
<pre>
 +
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min.js"></script>
 +
</pre>
 +
 +
=== backbone.js ===
 +
 +
Backbone.js is a [[JavaScript library]].
 +
 +
Add a script element to your web page, like this:
 +
 +
<pre>
 +
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.5.3/backbone-min.js"></script>
 +
</pre>
 +
 +
=== Custom JavaScript ===
 +
 +
Add an external JavaScript file of your own, for your custom JavaScript.  Like this:
 +
 +
<pre>
 +
<script src="backbone-exercise-1.js"></script>
 +
</pre>
 +
 +
For convenience, create your custom JavaScript file in the same folder as your exercise.
 +
 +
You could put your custom JavaScript file in your '''scripts''' (where your jQuery file is located).
 +
 +
However, the '''scripts''' folder is best used for external JavaScript files which will be shared by two or more web pages.
 +
 +
Since the external JavaScript for this exercise will not be shared by other web pages, it's fine to store the JavaScript file in the exercise folder.
  
 
=== Update your home page ===
 
=== Update your home page ===

Revision as of 11:07, 11 April 2016

Week Nine of Web Design and Development II (MGDP2050).

See also Week Eight (MGDP2050) - Week Ten (MGDP2050).

Lecture notes

See Week Nine lecture notes (MGDP2050).

Exercises: by next week

Goal: demonstrate Backbone.js

Demonstrate a simple Backbone.js application.

Study this example:

Compare the instructor's example:

Create week9 folder and web page

In your local root folder, create a new folder named week9.

Inside your week9 folder, create a web page named index.html.

  • Use your standard Bootstrap exercise layout and CSS
  • Set the page title appropriately

underscore.js

Underscore.js is a JavaScript library. This library is required by Backbone.

Add a script element to your web page, like this:

<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min.js"></script>

backbone.js

Backbone.js is a JavaScript library.

Add a script element to your web page, like this:

<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.5.3/backbone-min.js"></script>

Custom JavaScript

Add an external JavaScript file of your own, for your custom JavaScript. Like this:

<script src="backbone-exercise-1.js"></script>

For convenience, create your custom JavaScript file in the same folder as your exercise.

You could put your custom JavaScript file in your scripts (where your jQuery file is located).

However, the scripts folder is best used for external JavaScript files which will be shared by two or more web pages.

Since the external JavaScript for this exercise will not be shared by other web pages, it's fine to store the JavaScript file in the exercise folder.

Update your home page

On your Home page, make a link to this exercise.

Upload to web server

Upload your work to the classroom web server.

See also