CSC 112 Intro to Computer Programming in JavaScript Spring 2005.

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

1 Programming the Web: HTML Basics Computing Capilano College.
HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Chapter 16 The World Wide Web.
4.01 How Web Pages Work.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Web development  World Wide Web (web) is the Internet system for hypertext linking.  A hypertext document (web page) is an online document. It contains.
CIS101 Introduction to Computing Week 05. Agenda Your questions Exam next week - Excel Introduction to the Internet & HTML Online HTML Resources Using.
Layer 7- Application Layer
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Why Worry About the WWW? Intranets -- with lots of HR applications »policies/procedures »job postings »benefits & other transactions »hiring & other workflows.
Presenting Information on WWW using HTML. Presenting Information on the Web with HTML How Web sites are organized and implemented A brief introduction.
Chapter 16 The World Wide Web. 2 Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Write basic HTML.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 12.
Chapter 16 The World Wide Web Chapter Goals ( ) Compare and contrast the Internet and the World Wide Web Describe general Web processing.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Semester 1 CHAPTER 15.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
Internet Information ISYS 105B. What is the Internet? Comprised of network of computers Started in 1969 by U.S. Defense Dept.
The Internet Writer’s Handbook 2/e Introduction to World Wide Web Terms Writing for the Web.
2013Dr. Ali Rodan 1 Handout 1 Fundamentals of the Internet.
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
Postacademic Interuniversity Course in Information Technology – Module C1p1 Contents Data Communications Applications –File & print serving –Mail –Domain.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
JavaScript Part 1.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
Chapter 16 The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
HTML,DHTML & Javascript/Session1/1 of 39 Introduction and Basic Tags Session 1 of Using HTML, DHTML & JavaScript.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Write basic.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
UNESCO ICTLIP Module 1. Lesson 61 Introduction to Information and Communication Technologies Lesson 6. What is the Internet?
1 John Magee 9 November 2012 CS120 Lecture 17: The World Wide Web and HTML Web Publishing.
CA Professional Web Site Development Class 2: Anatomy of a Web Site and Web Page & Intro to HTML.
1 Welcome to CSC 301 Web Programming Charles Frank.
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 1.
High Points CSCI 1710 Fall The Internet Packet switching Arpanet Cold War.
Chapter 29 World Wide Web & Browsing World Wide Web (WWW) is a distributed hypermedia (hypertext & graphics) on-line repository of information that users.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
CHAPTER 7 THE INTERNET AND INTRANETS 1/11. What is the Internet? 2/11 Large computer network ARPANET (Dept of Defense) It is international and growing.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Website Design, Development and Maintenance ONLY TAKE DOWN NOTES ON INDICATED SLIDES.
Application of the Internet 1998/12/09 KEIO University, JAPAN Mikiyo
The Internet What is the Internet? The Internet is a lot of computers over the whole world connected together so that they can share information. It.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Website Design and Construction Services and Standards.
HTML Hyper Text Markup Language. What is HTML HTML stands for the Hyper Text Markup Language. HTML stands for the Hyper Text Markup Language. HTML is.
Chapter 8 Introduction to HTML and Applets
Instructor Materials Chapter 5 Providing Network Services
“Under the hood”: Angry Birds Maze
High Points CSCI 1710 Spring 2016.
High Points CSCI 1710 Fall 2017.
Web Design and Development
Chapter 16 The World Wide Web.
4.01 How Web Pages Work.
High Points CSCI 1210.
Presentation transcript:

CSC 112 Intro to Computer Programming in JavaScript Spring 2005

Internet and WWW u Internet and WWW are not the same – Internet includes and other things u Internet is the computers and the means by which they physically connect to each other. u World Wide Web is the logical means of accessing the files on these computers, primarily as web pages.

Using the World Wide Web u Browsers Netscape Navigator Internet Explorer u Plug-ins Java Macromedia Flash Acrobat Reader … u Search Engines Yahoo and many others

Internet Protocols u TCP/IP – Transmission Control Protocol / Internet Protocol u FTP – File Transfer Protocol u http – Hypertext Transfer Protocol u telnet – for remote login to other computers, with local computer as dumb terminal

IP Addresses u Example – u For specific computers on the Internet u Information is passed between them in packets u A named address (next slide) is converted to an IP address by a Domain Name Server (DNS)

Named Addresses URL’s – Uniform Resource Locators http is the protocol com is the domain – others are edu, org, gov, … www. music.sony.com is the server computer Music is the folder on the server computer index.html is the file in the Music folder

Hypertext Markup Language u Describes with tags how web page should be formatted for display by browser u Container tags, thus and u Non container tags, thus or u Tags must be properly nested

Basic Skeleton of an HTML Page … …

Tags for Lists For an unordered list … For an ordered list …

Attributes of HTML Tags u Describe how to accomplish a result u Attributes may or may not have values, as in …. u BODY attributes include colors for links and for background u FONT attributes include color and size

Hypertext Links u anchor text (Absolute or relative URL’s) u anchor text u

Images in Web Pages u Images appear when page is loaded, with u Image files for web pages are of type GIF or JPG u Image files are loaded via links, with some text

Programming u The Client-Server Model u Compiling versus Interpreting u Embedding JavaScript code in a web page u The Syntax or grammar of a P.L. (programming language) –Variables – numbers and strings and booleans –Operators – arithmetic and comparison –Concatenating strings with the overloaded + operator –Expressions – modifying precedence with parentheses –Statements – the assignment operator, the terminal semicolon

Translating a Program to ML u Assembler Language (AL) u High Level Languages (HLL’s) Interpreting – Translate and execute on the fly Compiling – Translate source program to object program, then execute it, retaining translation for subsequent execution

JavaScript Objects Thus, var foo = new Object() Objects may contain primitives of type number, string, or boolean other objects ! methods, or functions Thus, function foobar (){ statement; … }

Creating Forms with HTML …

Processing Forms with JavaScript Events, such as onclick and onchange Functions as event handlers Local variables in functions Converting strings to numbers with parseFloat() Arrays, as with var numbers = new Array() The elements array, automatically, for all of the items in the form selectedIndex for pull-down menus

Arrays u The array is a special kind of object var foo = new Array ( ); where the items in foo are indexed by integer values, thus foo[1], foo[j], foo[2*k+3]…  If the first index value is 0, it is a standard array, as with elements[ ] and options[ ]  A property of an array is its size, as with foo.length

Basic Tags for Tables … …

Attributes of TableTags u … ALIGN, BGCOLOR, BORDER, CELLPADDING, CELLSPACING, HEIGHT, WIDTH u … ALIGN, VALIGN, BGCOLOR u … ALIGN, VALIGN, BGCOLOR, COLSPAN, ROWSPAN

Control Structures u Sequential Processing do A, then B, then C, … u Conditional Processing (branching or selection) if A is true, then do B, else do C u Iterative Processing (looping or repetition) while A is true, do B {and test A again}

Conditional Processing Comparison operators Boolean variables Logical operators for and, or, not if (boolean condition) { statement; … } else { statement; … }

Iterative Processing u Must have three components - Initialize the loop control variable (lcv) –Test the lcv for termination –Update the lcv to next value u Thus, we have the for statement for (j = 0 ; j < 10 ; j += 1) { statement; } u We also have the while statement j = 0; while (j < 10) { statement; j += 1; }

Understanding Iteration u Word Problems To compute the number of days in the years days = 0; for (years = 1950 ; years <= 2000 ; years++) if (years % 4 == 0) days += 366; else days += 365; u Tracing Iteration for (j = 1 ; j <= 3 ; j++) for (k = 0 ; k < j ; k++) document.write (j + “ ” + k + “ ”);

Functions u Function definition (in the HTML head), thus function foobar (a, b, c) { statement; } where a,b,c are formal parameters. u Function invocation or function call, thus foobar (5, j, “Hello”); where the values in parentheses are actual parameters; when foobar is called, a=5, b=j, and c=“Hello”

Cookies u Name - Value pairs are just text strings! u When server responds to client request, it sends cookie to be stored on client. u When browser sends request to server, it retrieves cookie (if present) for server. u The GOOD for customizing user interface to server for implementing shopping carts u The BAD without user knowledge or consent contribute to junk mail and spamming u JS code to SetCookie(), GetCookie(), getCookieVal(), DeleteCookie()

Sources of Errors u Typing errors u Syntax errors – incorrect grammar syntax is how a message is given u Logical errors – incorrect semantics semantics is the meaning u Poor algorithms u Bad input values – GIGO u Incorrect specification of the problem

Computer Ethical Issues u Privacy versus security u Spamming u usage u Hacking u Ownership and piracy …