Javascript and the Web Whys and Hows of Javascript PowerPoint Presentation, PPT - DocSlides

Download tawny-fly | 2018-03-12 | General Introduction to Javascript. Most popular languages:. . COBOL, FORTRAN, C, C (Java (Script)). Javascript. interpreted. language that resembles C . Used in conjunction with HTML. Development of interactive web pages. ID: 648882

PowerPoint Javascript and the Web Whys and Hows of Javascript PowerPoint Presentation, PPT - DocSlides Slideshow

Slide1Javascript and the WebWhys and Hows of Javascript.Slide2Introduction to JavascriptMost popular languages: COBOL, FORTRAN, C

  • Views 38
Download this presentation

Javascript and the Web Whys and Hows of Javascript PowerPoint Presentation, PPT - DocSlides

Click below link (As may be) to download this presentation.

Download Note - The PPT/PDF document "Javascript and the Web Whys and Hows of ..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentations text content in Javascript and the Web Whys and Hows of Javascript PowerPoint Presentation, PPT - DocSlides

  • Javascript and the Web
  • Whys and Hows of Javascript
  • Introduction to Javascript
  • Most popular languages:
  • COBOL, FORTRAN, C, C++ (Java (Script))
  • Javascriptinterpreted language that resembles C++ Used in conjunction with HTMLDevelopment of interactive web pages
  • Java
  • * *
  • Object-oriented language
  • Looks a lot like Javascript
  • compiled (not interpreted by a browser)Used for writing web applets Much more sophisticatedWhy not learn Java, then?
  • Java is for advanced programmers and
  • Javascript is much more fun!
  • Why Javascript
  • Lightweight
  • Fast
  • Powerful Data Entry ValidationReduces server burden
  • Handles cookiesFUN!Livens pages up
  • Web Pages with Javascript
  • * * * *
  • HTML code
  • Javascript code
  • Web Page Source
  • Browser interprets
  • Web Page
  • Use Homesite to help with
  • 1.
  • Html creation
  • 2.
  • Javascript creation
  • 3.
  • Viewing Web Page
  • A First Program
  • 1.
  • <HEAD>
  • 2. <TITLE>My World</TITLE>
  • 3. <SCRIPT language="JavaScript"> <!-- HTML comments and hide script from old browsers ......Javascript Statements....... //--> Close comment section and browser reads on 4. </SCRIPT> 5. </HEAD>
  • < >
  • HTML start tags
  • </>
  • End tag<HEAD> … </HEAD>
  • <TITLE> … </TITLE><HTML> … </HTML//><Script> … </Script>
  • Parts of a Simple Program Tags
  • * * * *
  • 1.
  • <SCRIPT language="JavaScript">
  • Starting JavaScript commands
  • 2. <!-- hide script from old browsers
  • older browsers don't display your script as text3. alert('Welcome to my Web Site!'); Alert message goes inside single quotes. The semicolon separates JavaScript commands. 4. //--> Stops hiding the script from old browsers. 5. </SCRIPT>
  • Ends the JavaScript commands.
  • A Simple Javascript Program
  • * * *
  • charset – encoding
  • defer – will not generate any document content
  • id – identifier
  • language – language of the script (Javascript)src – external source for the code
  • script Tag Attributes* * * *
  • 0
  • <noscript> … </noscript>
  • <noscript>
  • Sorry your browser doesn’t support it
  • </noscript>
  • * * * *
  • noscript
  • 1
  • Attribute SRC
  • Language versions
  • Include multiple scripts for different versions
  • <script language=“javascript 1.1” src= “script.js”> … </script>
  • * * * *
  • External Script Files
  • 2
  • A few Javascript Commands
  • alert --
  • alert (‘your message’)
  • pops up a window with your message
  • document.write – document.write (“message”); puts message on the pageonMouseover … <A HREF="jmouse.htm" onMouseover="window.status='Hi there!'; return true"> Place your mouse here!</A> document.bgcolor – document.bgcolor=“white”
  • 3
  • When do scripts Run?
  • When document loads, or
  • Just after the document loads, or
  • When the user performs some action
  • 4
  • Inline scripts
  • Use quotes with HTML code
  • Quotes inside quotes, need different quotes
  • <input type=“button” … onClick=“alert( ‘ hello’ )” …>
  • 5
  • Viewing Script
  • Errors
  • In IE
  • status bar at bottom of browser small icondouble clickshow details
  • In Netscape, navigate to javascript:Click on File, Open pageType javascript:Click open
  • 6
  • Server Side Scripts
  • Server tags
  • Not all servers support
  • Cpsc 317 for “good” techniques
  • 7
  • Objects
  • 8
  • Events
  • 9
  • Events continued
  • 0
  • Reserved Words
  • Words that have special meanings in the language. They must be used only for their specified purpose. Using them for any other purpose will result in a error.
  • e.g.
  • alert do if
  • for while else *
  • 1
  • Javascript Statements
  • controls the sequence of execution
  • evaluates an expression
  • Always ends with a semicolon or brace.
  • *
  • 2
  • Comments
  • //
  • These are important parts of a program.
  • DO: Add comments to source code. Keep comments up to date.
  • Use comments to explain sections of code.
  • Don't:
  • Use comments for code that is self-explanatory.
  • * *
  • 3
  • Style for Variable Definitions
  • group definitions at the beginning
  • <script
  • language =“Javascript” definition statements; other statements; </script>
  • *
  • 4
  • Style for Control Structures
  • blank lines before and after control structures
  • statements;
  • if (expression) { statement; statement; }
  • statements;
  • * * *
  • 5
  • Basic Program Format
  • < Script language=“javascript”>
  • <!– non javascript browsers ignore
  • // Programmer: John Doe
  • // Date: Jan. 15, 2000// Examples of Javascript statements
  • var dateandtime=new Date(); //String date
  • var hours=dateandtime.getHours(); // String hours
  • var today; // integer day
  • Program Comment at top.
  • With your name & date.
  • Program
  • description
  • .
  • Note the use of blank lines.
  • * * * *
  • Document variable definitions and place them first
  • 6
  • Basic Program Format
  • (cont)
  • One statement per line.
  • Indent all lines within matching {}
  • equally (2-4 spaces).
  • Whitespace before and after control structures.
  • Space around operators.
  • * * * * *
  • for (i = 1; i <= 100000; i++)
  • {
  • document.bgColor = "red";
  • document.bgColor = "white";
  • document.bgColor = "blue";
  • };
  • today = dateandtime.toLocaleString().substring(0,10);
  • alert ("Today's date is "+today+"");
  • document.write("Welcome <br>")
  • 7
  • Basic Program Format
  • (cont)
  • Indent all lines within matching {}
  • equally (2-4 spaces).
  • Whitespace before and after control structures.
  • * * * * *
  • if (hours >= 12) {
  • document.write("Good Afternoon");
  • }else{
  • document.write("Good Morning");
  • }
Recommended
How Travelling With Your Kids Can Improve Their Education
  • 23

How Travelling With Your Kids Can Improve Their Education

Dental care for seniors
  • 26

Dental care for seniors

Employment Background Checks:
  • 47

Employment Background Checks:

Office of  &lt;EM, NNSA, SC)&gt;
  • 31

Office of <EM, NNSA, SC)>

The Odyssey :  Introduction &amp;
  • 24

The Odyssey : Introduction &

Wordpress website development
  • 62

Wordpress website development

Display Screen Equipment (DSE)
  • 54

Display Screen Equipment (DSE)

1 Project Management Tools
  • 49

1 Project Management Tools

Child safety Dr  M A  Maleque
  • 39

Child safety Dr M A Maleque

Report this Document.