Starting from:

$25

CSE270E Module 10 Assignment CSE270e Nodejs Solved

In this assignment you will extend the weather/temperature application from Chapter 3 so that it also has a second page that displays the daily summary.

 

1)    Copy over the temperature application from the book to your nodejs working copy. Call this directory AssigmentModule10.  Note: This working copy should NOT be in put /var/www/html since we do not want the apache server to be able to "serve" it. This working copy should be in your /home/ubuntu directory.

2)    In index.ejs add an "id" field to the form. The code in the book uses the tag $(form) to access the form. This is somewhat bad practice since this will add the on submit handler to all forms.  We want to modify this so it has a specific form it references. In index.ejs add the id "indexform", <form id="indexForm"...  Now in the public/the.js file modify the code so it uses this new name. Change $(form) to $("#indexForm")....

3)    Go ahead and test that it still works.

4)    Now add a second page. Copy over index.ejs to summary.ejs and

a)     modify summary.ejs's form id to be "summaryForm"

b)     Add links to index.ejs and summary.ejs to each other. Add these links just before the closing body tag.

5)    Modify app.js so it has a handler for /summary that calls summary.ejs

6)    Extend the existing app.js ajax code so that it returns a field called daily.summary to the JSON.

7)    In the code the.js copy over the submit handler and make a new submit handler for summaryForm.  In this form replace code that displays the temperature with code that will display the daily summary.

8)    Make sure to add comment blocks to all your code with your name, date, class and assignment.

9)    Run this server on port 3010

10)Submit a clickable link to

a)     your git repo.

b)     your running instance 

More products