GPA Calculator Project JavaScript For Web Developing CS175 – Spring 2008 Won Liu Final Project Presentation 5/20/2008.

Slides:



Advertisements
Similar presentations
Essentials for Design JavaScript Level One Michael Brooks
Advertisements

HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
The Web Warrior Guide to Web Design Technologies
JavaScript (Part 2) CS 183 4/13/2010. JavaScript (Part 2) Will cover: ◦ For.. In ◦ Events ◦ Try.. Catch, Throw ◦ Objects.
Chapter 7 © 2001 by Addison Wesley Longman, Inc. 1 Chapter 7 Sebesta: Programming the World Wide Web.
1 HCI 201 JavaScript - Part 1. 2 Static web pages l Static pages: what we have worked with so far l HTML tags tell the browser what to do with the content.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Computer Science 103 Chapter 4 Advanced JavaScript.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Introduction to scripting
Course Textbook: Build Your Own ASP.Net Website: Chapter 2
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Lesson 8 Creating Forms with JavaScript
CST JavaScript Validating Form Data with JavaScript.
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
UNIT 6 JAVASCRIPT EVENT HANDLERS &WEB BROWSERS DETECTION.
CP476 Internet Computing JavaScript and HTML1 1.JavaScript Execution Environment The JavaScript Window object represents the window in which the browser.
4.1 JavaScript Introduction
JavaScript and The Document Object Model MMIS 656 Web Design Technologies Acknowledgements: 1.Notes from David Shrader, NSU GSCIS 2.Some material adapted.
Server vs Client-side validation. JavaScript JavaScript is an object-based language. JavaScript is based on manipulating objects by modifying an object’s.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Online Shopping JavaScript project for CS 175 JavaScript for Web Development, Spring 2009 By Sita Akella.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Chapter 5 © 2003 by Addison-Wesley, Inc. 1 Chapter 5 JavaScript and HTML Documents.
Execution Environment for JavaScript " Java Script Window object represents the window in which the browser displays documents. " The Window object provides.
JavaScript Part 1.
JavaScript & DOM Client-side scripting. JavaScript JavaScript is a tool to automate client side (which is implemented using HTML so far) JavaSript syntax.
Lesson 19. JavaScript errors Since JavaScript is an interpreted language, syntax errors will usually cause the script to fail. Both browsers will provide.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
1 JavaScript in Context. Server-Side Programming.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
JavaScript - A Web Script Language Fred Durao
1 JavaScript
Introduction to JavaScript CS101 Introduction to Computing.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Web Development 101 Presented by John Valance
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
1 Javascript DOM Peter Atkinson. 2 Objectives Understand the nature and structure of the DOM Add and remove content from the page Access and change element.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
Introduction To JavaScript. Putting it Together (page 11) All javascript must go in-between the script tags. All javascript must go in-between the script.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
1 Javascript CS , Spring What is Javascript ? Browser scripting language  Dynamic page creation  Interactive  Embedded into HTML pages.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Introduction to.
Web Development & Design Foundations with HTML5
JavaScript is a programming language designed for Web pages.
© 2015, Mike Murach & Associates, Inc.
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
JAVASCRIPTS AND HTML DOCUMENTS
Integrating JavaScript and HTML
Web Development Using ASP .NET
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
JavaScript: Introduction to Scripting
Retrieving information from forms
Presentation transcript:

GPA Calculator Project JavaScript For Web Developing CS175 – Spring 2008 Won Liu Final Project Presentation 5/20/2008

5/20/2008 Page 2 Ohlone GPA Calculator A class project that requested from Ohlone Student Transfer Center Calculate students Grade Point Average

5/20/2008 Page 3 Features Build the GPA Matrix/table cells and rows dynamically using the DOM Model, HTML code along with Javascript functions Perform user input validation & error handling Calculate the grade point for a course dynamically Implement two different screen layouts

5/20/2008 Page 4 Layout 1: Text fields for both Semester & Quarter sessions

5/20/2008 Page 5 Layout 2: Use Radio button for the session choice

5/20/2008 Page 6 Comparisons of Two Layouts Layout 1: Straight forward More validations on two text fields Layout 2: Less validations IE 6 does not support DOM-insertion of Radio button. A bit Chanllenging in making a dynamically created radio box worked in the IE browser

5/20/2008 Page 7 Coding Excert Use the insertRow method to insert / create a table row. Use the insertCell method to insert / create a table cell to a table row Use createElement method to create an instance of the element for the specified tag in the table cell e.g. document.createElement('select'); Use setAttribute method or object.attributeName to set the attributes for the tag e.g. course.setAttribute (“type”, “text”); course.type = “text”;

5/20/2008 Page 8 Coding Excert (continued) Assign an event handler to the text field created via DOM methods e.g. sel.onchange = function() {check(row) }; or text.onchange = function() {validation (text)}; Note: onchange must be lower case Use appendChild method to append a new created element to the table cell

5/20/2008 Page 9 What I have Learned Be able to apply the following techniques that I learned from this class and make this GPA project worked DOM Model – Dynamically creates table rows and cells. Browser detection HTML forms and control elements. String manipulations (chatAt(), indexOf() ) Math.pow() & Math.round() Functions, loops,..etc.

5/20/2008 Page 10 What I have Learned (continued) New thing I learned by doing this project: Dynamically adding new table rows An event handler is case-sensitive (lower case) when attach to a dynamically created element A solution to create a radio box inside of a dynamically created table cell to get around the IE browser 6.0 problem A JavaScript Verifier, JSLint

5/20/2008 Page 11 Difficulity Encountered Not much difficulity, except : Lack of knowledge on JavaScript debugging tool I often just sprinkling alert() around the code to locate the problem; if alert box didn’t appear, (e.g. mis-typing a ‘ for a ‘’ sytax error), need to go through code line by line or put more alert(); not efficient IE silently failed The Radio button was created, but unable to be checked. Went through code line by line, couldn’t figure out why. The same code (for Layout 2) works on FireFox Browser but not on IE browser

5/20/2008 Page 12 Discoveries When defining event handler in HTML inline, the case is in-sensitive. But when defining event handler in JavaScript, the case is sensitive. The event handler should be always lowercase text.onchange = function() {validation (text)};

5/20/2008 Page 13 Discoveries (contonied) Window IE 6 does not support DOM-insertion of Radio button After several searches, I discovered that IE doesn’t allow the name attribute to be changed after the element is created. The Radio button can’t be set in a DOM compatible way during creation. Tried out a couple of work-around & found out a solution Work- around solution ( very easy after figured it out ) If (IE_browser) radio1 = document.createElement(" "); else { radio1 = document.createElement("input"); radio1.type = “radio”; radio1.name=“radio1” ….. }

5/20/2008 Page 14 Discoveries (continued) Explored JSLint, the JavaScript Syntax Checker & Verifier Scan JavaScript source code. If a problem is found, returns a message describing the problem and an approximate location within the source Identify missing “;” or a “unclosed” string. Identify variables without “var” as “implied global” Identify function was used before was defined However, always complains the “hiding line”, “, need to comment it out Help in syntax error

5/20/2008 Page 15 Link to the working code <a href=“ Calculator <a href=“ Calculator2

5/20/2008 Page 16 Acknowledgement - Thanks I want to thank Professor Degallier for teaching us. His professionalizm, prompt relies, and wonderful class setup ( class page, discussion board) really inspire me to learn I had fun and really enjoyed this class I also want to thank classmates for sharing their works, good and open discussions