BMES514 – Fall 2010 David R. Brooks Institute for Earth Science Research and Education 610-584-5619

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
CIS101 Introduction to Computing Week 05. Agenda Your questions Exam next week - Excel Introduction to the Internet & HTML Online HTML Resources Using.
HTML Comprehensive Concepts and Techniques Second Edition Project 8 Integrating JavaScript with HTML.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
CIS101 Introduction to Computing
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Introduction to HTML 2006 CIS101. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
Introduction to HTML 2006 INT197B. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
Introduction to HTML 2004 CIS101. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Inline, Internal, and External FIle
CIS101 Introduction to Computing Week 06. Agenda Your questions Excel Exam during second hour Our status after the snow day Introduction to the Internet.
Introduction to scripting
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
Internet Skills An Introduction to HTML Alan Noble Room 504 Tel: (44562 internal)
PHP == ‘ Hypertext Preprocessor ’ Open-source, server-side scripting language Used to generate dynamic web-pages PHP scripts reside between reserved PHP.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
JavaScript: Control Structures September 27, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel,
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Week 9 PHP Cookies and Session Introduction to JavaScript.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Chapter 8 Cookies And Security JavaScript, Third Edition.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Fall 2004CSI University of Ottawa Introduction to PHP Basic principles and syntax.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
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.
XP Tutorial 8 Adding Interactivity with ActionScript.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
1 2/16/05CS120 The Information Era Chapter 4 Basic Web Page Construction TOPICS: Intro to HTML and Basic Web Page Design.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Beginning JavaScript 4 th Edition. Chapter 1 Introduction to JavaScript and the Web.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
PHP using MySQL Database for Web Development (part II)
Project 1 Introduction to HTML.
“Under the hood”: Angry Birds Maze
PHP Introduction.
PHP.
An Introduction to JavaScript
Presentation transcript:

BMES514 – Fall 2010 David R. Brooks Institute for Earth Science Research and Education “ “ The best way to become acquainted with a subject is to write a book about it. ” -- Benjamin Disraeli

Introduction Purpose of this course: To learn principles of programming using the HTML/JavaScript/PHP environment. Better than a “conventional” programming language? Learning by example: Most online Web page development material involves learning by example (i.e., “copying other people’s work”). Make sure you learn, and don’t just learn to copy. (It doesn’t work, anyhow.) Intellectual honesty counts! Reference online sources just as you would print or other sources. Online plagiarism has the same consequences as other forms of plagiarism.

Resources Brooks, David R.: An Introduction to HTML and JavaScript for Scientists and Engineers. Springer, ISBN: Brooks, David R.: An Introduction to PHP for Scientists and Engineers: Beyond JavaScript. Springer, ISBN Thomas Powell and Dan Whitworth, HTML Programmer’s Reference, Second Edition, 2001, Osborne/McGraw-Hill, Berkeley, CA. ISBN Thomas Powell and Fritz Schneider, JavaScript: The Complete Reference, 2001, Osborne/McGraw-Hill, Berkeley, CA. ISBN Todd Stauffer, Using HTML 3.2, Second Edition, 1996, Que Corporation, Indianapolis, IN. ISBN Thomas Powell, HTML: The Complete Reference, Third Edition, 2001, Osborne/McGraw-Hill, Berkeley, CA. ISBN us2.php.net/manual/en (online PHP information)

The 5 steps in Solving Computing Problems 1. Define the problem. 2. Outline a solution 3. Design an algorithm 4. Convert the algorithm to a program. 5. Verify the operation of the program.

Pseudocode for Developing Algorithms ASSIGN Set a variable equal to a value, another variable, or an expression. See also INCREMENT and INITIALIZE. CALL Invoke a subprogram. See SUBPROGRAM. CHOOSE Take action based on a restricted list of possibilities. CLOSE Close an open file. DEFINE Define variables and user-defined data types.

Pseudocode for Developing Algorithms IF… THEN… ELSE… If something is true, take a specified action. If false, take some other action (including doing nothing). INCREMENT (DECREMENT) A special type of assignment statement, such as x=x+1. INITIALIZE A special kind of assignment statement used to set initial values in a program. LOOP (conditions)… END LOOP Execute instructions repeatedly until (or as long as) certain conditions are met.

Pseudocode for Developing Algorithms OPEN Open an external file. READ Pass information to a program through an interface or from an external file. SUBPROGRAM Marks the start of a subprogram module, used to specify the flow of information between parts of a program. WRITE/DISPLAY Display or save output from a program.

The Nature of HTML/JavaScript/PHP HTML is a “language” in the sense that it provides instructions for displaying content and provides a user interface for modifying content (but not the actual capabilities for modifying that content). We will use a “platform independent” (??) subset of HTML. HTML has syntax rules that are only loosely enforced (see XHTML). It ignores bad syntax rather than "crashing.” JavaScript is a “client side” programming language that can manipulate the content of HTML documents. JavaScript has syntax rules that are actually enforced, but not all browsers support all JavaScript features. PHP is a language for manipulating information passed from an HTML document (or a command line), including using that information to access, create, modify (and destroy) files on remote servers. Its capabilities do not depend on browser implementations.

To summarize… JavaScript is a “client-side” language that cannot access information on a remote server. PHP is a “server-side” language that resides on a remote server and can read and write files on that server. Both JavaScript and PHP are C-like languages that can be used for science and engineering applications.

Chapter 1: 1.1 Introducing the Tools What is an HTML document? What is JavaScript? How do you create an HTML/JavaScript document?

Chapter 1: 1.1 … Tools What is an HTML document? A series of “ tags ” in a text file that are used to control the appearance of content. … … …

Chapter 1: 1.1 … Tools What is JavaScript? JavaScript is an interpreted object-oriented programming language. It is used to manipulate the contents of HTML documents. It is used for writing client-side applications that cannot access information on a host computer.

Chapter 1: 1.1 …Tools How do you create an HTML/JavaScript document? You can use a simple text editor, even Windows’ Notepad, but… It is much better to have a “real” HTML/JavaScript/PHP editor. You do not need elaborate Web-content creation software. We will use AceHTML 5.0, a freeware script editor. You need a browser, with or without Web access, to view HTML documents. The browser must also implement JavaScript. Later, you will need access to a server that supports PHP.

Chapter 1: 1.2 Your First HTML/JavaScript Document Document 1.1 (HelloWorldHTML.htm) Hello, world! Hello, world! It's a beautiful day!

Chapter 1: 1.2 Your First HTML/JavaScript Document (alternate code) Document 1.2 (HelloWorld.htm) Hello, world! // These statements display text in a document. document.write("Hello, world!"); document.write(" It's a beautiful day!");

Output from Document 1.1 Documents 1.1 and 1.2 both producebasic default-formatted text output. The font may differ among browsers, but probably it will be Times New Roman, or some similar serif font, black against a white background.

Fancier Output… Document 1.3 (HelloWorld2.htm) Hello, world! First JavaScript document.write("<font size='5' color='red'> Hello, world! "); document.write(" It's a beautiful day! ");

Output from Document 1.3 Now we have taken control over text size, color, and formatting by assigning values to attributes of the font element.

More Options… Document 1.4a (HelloWord3.htm) Hello, world! (v.3) First JavaScript document.write(" This document was last modified on " +document.lastModified+" "); document.write("background = "+document.bgColor); document.write(" font = " + document.fgColor); document.write("<font size='5' color='red'> Hello,world! "); document.write(" He said, "It's a beautiful day!" ");

Output from Document 1.4a This output includes output from the lastModified property of the document object. It also shows the hex codes for some colors.

Document Properties and Methods Property or Method and UseAction Property document.bgColor Returns current value of background (page) color. Returns "#ffffff" for Property document.fgColor Returns current value of font color. Returns "#0000ff" for Property document.lastModified Returns text string containing date the document was last modified. Method document.write("Hello!") Prints quoted string on document page. Method document.writeln("Hello!") Prints quoted string on document page, followed by line feed. *

Chapter 1: 1.3 Accessing HTML Documents on the Web HTML documents are accessible locally, with any computer that has a browser, and globally if the document is on an Internet-accessible server. A typical URL: index.htm or index.html is always the default “home page.” This means that is equivalent. Locally, clicking on any file with an.htm or.html extension should open that file in your browser.

Chapter 1: 1.4 Another Example Document 1.5 (house.htm) Our New House document.write(" This document was lastmodified on "+document.lastModified+" "); Our New House Here's the status of our new house. (We know you're fascinated!)