client side programming

profileamathi
a3.zip

A3/A3.docx

IT 3046 JQuery: Assignment 3 Fall 2015

Total: 40 points

All assignments should be individual work. Discussion with class mates is allowed but the final code has to be written individually. If you take code from any Web site, provide the links in your submission files.

All the files you need for this exercise are available on Blackboard->Schedule->A3.zip

Use jQuery for solving all problems.

1. (20 points) This problem is from A1 –use jQuery & HTML forms to re-write the application. Do not use prompts/alerts. Error check user entry for letters/negative numbers using the span tag.

Write a check out program that calculates the total cost (cost of items + 6% sales tax) of buying two items. Use floats for this problem and format them to 2 decimal places. Sample calculation:

Cost of Item1: 16.00

Cost of Item2: 38.55

Cost of items: 54.55

6% Sales tax = 3.27

Total cost = 57.82

2. (20 points) In this exercise, you’ll develop an application that displays the first paragraph of text for three topics and then lets the user click a link to expand or collapse the text for each topic.

· Begin with the file index.html in the expand_collapse folder. Then, run the application to see that the first paragraph of text is displayed for each topic, along with a link that lets you display additional text. Note, however, that the links don’t work.

· You can use the wk8-faq.js or the faq example in the book on page 221 as a base for solving this problem. Reading pages 260, 261 & 279 will also be helpful in understanding jQuery methods.

· Submission Upload your HTML files as a .zip file to Blackboard under Submit Assignments ->Assignment 3. Name your file as YourUsername_A3.zip e.g. If I were to upload it, it would be mutsuday_A3.zip

Test your code on a wide range of inputs. Some exercises show some sample inputs and the expected results. Use these examples as a starting point.

Page 2 of 2

A3/expand_collapse/a3_2.js

//write javascript using jQuery here

A3/expand_collapse/index.css

/* type selectors */ article, aside, figure, figcaption, footer, header, nav, section { display: block; } * { margin: 0; padding: 0; } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 87.5%; width: 650px; margin: 0 auto; border: 3px solid blue; } section { padding: 15px 25px; } h1 { font-size: 150%; } h2 { font-size: 120%; padding: .25em 0 .25em 25px; } div.hide { display: none; } ul { padding-left: 45px; } li { padding-bottom: .4em; } p, a { padding-bottom: .4em; padding-left: 25px; }

A3/expand_collapse/index.html

Murach's JavaScript and DOM Scripting

Book description

You can read other JavaScript books from start to finish and still not know how to develop dynamic websites like you want to. That's because it's DOM scripting that lets you do things like run slide shows, handle image rollovers, rotate headlines, provide animation, and more. And it's a subject that's glossed over or ignored in most other books.

But now, you can go from JavaScript beginner to DOM scripting expert in a single book! Fast-paced, professional, and packed with expert practices, our new JavaScript book guides you through each step as you learn how to program sites that enhance the user experience and ensure browser compatibility.

Show more

About the author

Ray Harris is an expert JavaScript programmer. That will be obvious to you as soon as you review the 20 complete applications that he presents in this book.

Ray Harris is much more than a JavaScript programmer. He has a Master's degree in Computer Science and Artificial Intelligence. He worked on advanced research projects at the Air Force Research Lab while he was in the USAF. He taught information security and web development at the College of Technology in Raleigh, North Carolina. In fact, Ray has been programming and teaching since he was 12 years old.

So when Ray said he wanted to write for us, it didn't take us long to hire him. Not only did he have the technical skills that we were looking for, but his previous writings showed that he had an uncommon ability to think, write, and teach.

Show more

Who this book is for

Due to our unique presentation methods and this book's modular organization, this is the right book for any web developer who wants to use JavaScript effectively.

Here's just a partial list of who can use this book:

  • Web developers who know HTML and CSS and are ready to master JavaScript.
  • Web developers who program in ASP.NET, JSP, or PHP on the server side and now want to master client-side coding.
  • Web developers who have already read 3 or 4 JavaScript or DOM scripting books but still don't know how to do the type of DOM scripting that's required in real-world applications
Show more

A3/sales_tax/a3_1.js

//write javascript using jQuery here

A3/sales_tax/index.css

/* type selectors */ article, aside, figure, figcaption, footer, header, nav, section { display: block; } * { margin: 0; padding: 0; } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 87.5%; width: 650px; margin: 0 auto; border: 3px solid blue; } section { padding: 15px 25px; } h1 { font-size: 150%; } h2 { font-size: 120%; padding: .25em 0 .25em 25px; } div.hide { display: none; } ul { padding-left: 45px; } li { padding-bottom: .4em; } p, a { padding-bottom: .4em; padding-left: 25px; }

A3/sales_tax/index.html