JavaScriptWhy..What..How?Mohammed Alhusban
Introduction  (5 Mins)Simple Program: Printing a Line of Text in a Web Page (10 Mins)Prompt Dialogs: Obtaining User Input  Dynamic Welcome PageOutlineWhy & What How
Why JavaScript?Enhances functionality and appearance of the web page.Client-side scriptingMakes pages more dynamic and interactiveEasy-to-useBuilt into web browsers and other applicationsOffering functions such as Form validation (JS can be used to validate data before it is submitted to a server. This saves the server from extra processing).JavaScript can be used to set and retrieve web cookies (A JavaScript can be used to store and retrieve information on the visitor's computer).Cool stuff like drop-down menus.Hide and show elements.Animation.JS
5 Websites That use JavaScript Animation Effectively!!
What is JS? JavaScript is a very popular scripting language on the internet.Cross Platforms. JavaScript language runs inmultiple environments and on many platforms.JavaScript is usually embedded directly into HTML pages.JavaScript is an interpreted language (means that scripts execute without preliminary compilation)      Father of JS      Brendan Eich
How..?
Before going any furtherOne of the most important things to do when learning a new language is to master basic input and output which is why Welcome to has become almost a cliché in programming textbooks.Output Methodsdocument.writeln (ex.1)
Windows.alert (ex.2)input MethodsUsing variable (ex.3)Code: Ex.1                         (Output)Java Script at the first sight.
Code: Ex.1html opening tag
Code: Ex.1html opening tag Usually Java Scripts are included within the head tag, it also could be included in the body tag.
Code: Ex.1html opening tag Usually Java Scripts are included within the head tag, it also could be included in the body tag. One reason JavaScript is so popular is that it's relatively easy to add JavaScript to a web pageJavaScriptCode block
Code: Ex.1<script> tag: Indicate that the text is part of a script
Code: Ex.1type attribute: Specifies the type of file and the scripting language use.
Code: Ex.1<script> tag: Indicate that the text is part of a scripttype attribute: Specifies the type of file and the scripting language use.</script> End or Close Tag
Code: Ex.1A Method used to output a string onto the Browser
Code: Ex.1The string, that writeln method takes and printout on the browser.Whatever between the quotations mark will be printed as is.A Method used to output a string onto the Browser
Execute Ex.1:         OutputRun
Code: Ex.2
Code: Ex.2Popup windows
Code: Ex.2String will be printed out on the msg box or popup windowPopup window
Execute Ex.2:             Output
Execute Ex.2:
JavaScript Data Types and VariablesVariable is a facility for storing data. The current value of the variable is the data actually stored in the variable.Variable in JavaScript has name and valueDeclare a variable  give it a name ( ex. var x )Initialize a variable  give it a value ( ex. x = 100)In order to use variable, they must be declared and initialized. Variable types are not important in JavaScript. They may be interchanged as necessary. This means that if a variable is a string one minute, it can be an integer the next.Declare  initialize  Call
Code: Ex.3
Code: Ex.3Declaration of a variable
Code: Ex.3You can declare JavaScript variables with the var statementWhat? Huh
Code: Ex.3Initialization of the variable (name)
Code: Ex.3Prompt window prints out the string between quotations
Code: Ex.3writeln method prints the following in the browser:string + value of the variable name + string Hello + name value (input name) + Welcome to JavaScript Programming!
Run: Ex.3
Next Lecture Learning to Love JavaScript PrototypesThank you, I hope you have enjoyed this presentation

Java Script

  • 1.
  • 2.
    Introduction (5Mins)Simple Program: Printing a Line of Text in a Web Page (10 Mins)Prompt Dialogs: Obtaining User Input Dynamic Welcome PageOutlineWhy & What How
  • 3.
    Why JavaScript?Enhances functionalityand appearance of the web page.Client-side scriptingMakes pages more dynamic and interactiveEasy-to-useBuilt into web browsers and other applicationsOffering functions such as Form validation (JS can be used to validate data before it is submitted to a server. This saves the server from extra processing).JavaScript can be used to set and retrieve web cookies (A JavaScript can be used to store and retrieve information on the visitor's computer).Cool stuff like drop-down menus.Hide and show elements.Animation.JS
  • 4.
    5 Websites Thatuse JavaScript Animation Effectively!!
  • 5.
    What is JS?JavaScript is a very popular scripting language on the internet.Cross Platforms. JavaScript language runs inmultiple environments and on many platforms.JavaScript is usually embedded directly into HTML pages.JavaScript is an interpreted language (means that scripts execute without preliminary compilation) Father of JS Brendan Eich
  • 6.
  • 7.
    Before going anyfurtherOne of the most important things to do when learning a new language is to master basic input and output which is why Welcome to has become almost a cliché in programming textbooks.Output Methodsdocument.writeln (ex.1)
  • 8.
    Windows.alert (ex.2)input MethodsUsingvariable (ex.3)Code: Ex.1 (Output)Java Script at the first sight.
  • 9.
  • 10.
    Code: Ex.1html openingtag Usually Java Scripts are included within the head tag, it also could be included in the body tag.
  • 11.
    Code: Ex.1html openingtag Usually Java Scripts are included within the head tag, it also could be included in the body tag. One reason JavaScript is so popular is that it's relatively easy to add JavaScript to a web pageJavaScriptCode block
  • 12.
    Code: Ex.1<script> tag:Indicate that the text is part of a script
  • 13.
    Code: Ex.1type attribute:Specifies the type of file and the scripting language use.
  • 14.
    Code: Ex.1<script> tag:Indicate that the text is part of a scripttype attribute: Specifies the type of file and the scripting language use.</script> End or Close Tag
  • 15.
    Code: Ex.1A Methodused to output a string onto the Browser
  • 16.
    Code: Ex.1The string,that writeln method takes and printout on the browser.Whatever between the quotations mark will be printed as is.A Method used to output a string onto the Browser
  • 17.
  • 18.
  • 19.
  • 20.
    Code: Ex.2String willbe printed out on the msg box or popup windowPopup window
  • 21.
  • 22.
  • 23.
    JavaScript Data Typesand VariablesVariable is a facility for storing data. The current value of the variable is the data actually stored in the variable.Variable in JavaScript has name and valueDeclare a variable  give it a name ( ex. var x )Initialize a variable  give it a value ( ex. x = 100)In order to use variable, they must be declared and initialized. Variable types are not important in JavaScript. They may be interchanged as necessary. This means that if a variable is a string one minute, it can be an integer the next.Declare  initialize  Call
  • 24.
  • 25.
  • 26.
    Code: Ex.3You candeclare JavaScript variables with the var statementWhat? Huh
  • 27.
    Code: Ex.3Initialization ofthe variable (name)
  • 28.
    Code: Ex.3Prompt windowprints out the string between quotations
  • 29.
    Code: Ex.3writeln methodprints the following in the browser:string + value of the variable name + string Hello + name value (input name) + Welcome to JavaScript Programming!
  • 30.
  • 31.
    Next Lecture Learningto Love JavaScript PrototypesThank you, I hope you have enjoyed this presentation