Your 1st Programming Assignment

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
The Web Warrior Guide to Web Design Technologies
JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Introduction to Javascript. Web Page Technologies To create Web Page documents, you use: To create Web Page documents, you use: HTML – contents and structures.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
DOM and JavaScript Aryo Pinandito.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
1 JavaScript in Context. Server-Side Programming.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Introduction to JavaScript Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. 1.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
JavaScript Introduction 1. What is Java Script ? JavaScript is a client-side scripting language. A scripting language is a lightweight programming language.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
1 JavaScript
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
05 – Java Script (1) Informatics Department Parahyangan Catholic University.
JavaScript. JavaScript is the programming language of HTML and the Web. Easy to learn One of the 3 languages of all developers MUST learn: 1. HTML to.
IS2802 Introduction to Multimedia Applications for Business Lecture 3: JavaScript and Functions Rob Gleasure
CIS 375—Web App Dev II JavaScript I. 2 Introduction to DTD JavaScript is a scripting language developed by ________. A scripting language is a lightweight.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
JavaScript and Ajax (JavaScript Basic) Week 2 Web site:
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Javascript Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Third lecture Event 27/2/2016 JavaScript Tutorial.
Introduction to.
Java Script Introduction. Java Script Introduction.
Javascript and Dynamic Web Pages: Client Side Processing
Unit M Programming Web Pages with
Using JavaScript to Show an Alert
Tutorial 10 Programming with JavaScript
JavaScript is a programming language designed for Web pages.
JavaScript Event Handling.
Unit M Programming Web Pages with
Introduction to Web programming
Web Development & Design Foundations with HTML5 7th Edition
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
14 A Brief Look at JavaScript and jQuery.
Introduction to JavaScript
JavaScript an introduction.
DHTML Javascript Internet Technology.
A second look at JavaScript
WEB PROGRAMMING JavaScript.
Events Comp 205 Fall 2017.
DHTML Javascript Internet Technology.
Functions, Regular expressions and Events
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Tutorial 10 Programming with JavaScript
E-commerce Applications Development
Introduction to JavaScript
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Web Programming and Design
Week 5: Recap and Portfolio Site
Barb Ericson Georgia Institute of Technology May 2006
Web Programming and Design
Web Programming and Design
Introduction to Web programming
Presentation transcript:

Your 1st Programming Assignment Showing reported crime entries on Google Map

Requirements Data Requirement Bonus Available in the class folder Create a web page (HTML+JavaScript) to show all entries Correct map locations Each entry is displayed as a marker Mouse over a marker to show its location. Requirement: map + location + markers +location tip Bonus Click a marker to show the time, location, and reported crimes associated with it.

Start from Here https://developers.google.com/maps/documentati on/javascript/adding-a-google-map

Web Programming

Separation of Functions Behavior (JavaScript) Presentation (CSS) Content (HTML) Richness of User Experience

JavaScript A client-side scripting programming language for dynamic web pages Must be run within a browser JavaScript PHP, JSP, ASP, etc.

Features of JavaScript A fully fledged programming language JavaScript under HTML 5 is very powerful. Lightweight: commanding fewer resources Integrated with HTML React to client-side events Supported by all major browsers Behaviors may vary slightly from browser to browser Limitations No access to local file system

How is JavaScript integrated with HTML? <script> … </script> Locations Inside <head>…</head> Dealing with user events or functions Either external or internal In <body>…</body> Writing document content

<html> <head> </head> <body> <script type="text/javascript"> document.write("Hello World!"); </script> </body> </html>

Internal: All Scripts Are in the Same HTML Document. <html> <head> <script type="text/javascript"> function message() { alert("Hello!"); } </script> </head> <body onload="message()"> //onload: to execute a JS when a page is loaded. </body> </html

External: Scripts Are in Another Document. <html> <head> <script type="text/javascript" src="another.js"></script> </head> <body> </body> </html>

Example

Exercise 1 Go to the class folder \\up.ist.local\Courses\Spring2017\IST402\InClassExercise sResources\Week1_JavaScriptGoogleMap Copy the HelloWorld.html document to your web space IST UP Webspace (W) Open a browser to visit this file with appropriate URL http://my.up.ist.psu.edu/youraccessid/HelloWorld.html

Exercise 2 After you complete Exercise 1, create an HTML document in your web space, named as psumap.html You can use any text editor you like. Copy the codes from the site: https://developers.google.com/maps/documentation/ja vascript/adding-a-google-map Use your own key Load your document in a browser.

Google Maps Map services through a browser Various APIs Maps: types of maps, scale, center Overlay objects: markers, polylines Events: on map and overlay objects How to use Google Maps? Web programming languages to call APIs APIs for different kinds of program languages JavaScript

Exercise 3 Modify the code so that the map is centered on our UP campus. How is the center of a map decided?

JavaScript Basics Statements Variables Events Functions

Statements <script type="text/javascript"> var a = 10; var b = 11; var c; c = a + b; alert(‘The answer is’ + c); </script>

JavaScript Variables Case sensitive Must begin with a letter or the underscore character Need to be declared var variableName

JavaScript Operators Arithmetic Operators Assignment Operators +,-,*,/,%,++,-- Assignment Operators =, +=, -=, *=, /=, %= Comparison Operators ==: value only ===: value and type != >,<,>=,<= Logical Operators &&, ||, !

Events What is happening to HTML elements. User and browser events onclick, onmouseover, onmouseout, onkeydown, etc. Example: onclick http://www.w3schools.com/js/tryit.asp?filename=tryjs_ event_onclick

Functions <script> function myFunction() { alert(Date()); } </script> <button onclick="myFunction()">The Time is?</button>

Coding Tips Semi colons in JavaScript Match on parentheses, brackets, quotes (), [], {}, "", '' Using tabs Variable names Capitalization Use the developer tools Chrome developer tools Firefox Developer tools Web console, JavaScript debugger Use comments // a single line comment /* more lines more comments */

For Your First Programming Assignment You need to deal with multiple markers. You need to know how to handle an array in JavaScript. You can start exploring this issue.