Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction - Introduction to Java Script - Lecture Slides, Slides of Javascript programming

Here is my collection on JavaScript lectures. It includes tutorials as well as general concepts explanations. Particularly these slides contain: Introduction, Site Navigation, Executes on Client, Naming Form Elements, Using Form Data, Tips

Typology: Slides

2013/2014

Uploaded on 01/29/2014

surii
surii 🇮🇳

3.5

(13)

182 documents

1 / 16

Toggle sidebar

Related documents


Partial preview of the text

Download Introduction - Introduction to Java Script - Lecture Slides and more Slides Javascript programming in PDF only on Docsity! Introduction to JavaScript docsity.com Introduction • What is it? • How does it work? • What is Java? • Learning JavaScript • JavaScript Statements • JavaScript and HTML forms docsity.com How Does It Work? • Embedded within HTML page • View source • Executes on client • Fast, no connection needed once loaded • Simple programming statements combined with HTML tags • Interpreted (not compiled) • No special tools required docsity.com What is Java? • Totally different • A full programming language • Much harder! • A compiled language • Independent of the web • Sometimes used together docsity.com Learning JavaScript • Special syntax to learn • Learn the basics and then use other people's (lots of free sites) • Write it in a text editor, view results in browser • You need to revise your HTML • You need patience and good eyesight! docsity.com JavaScript Statements <html> <head><title>My Page</title></head> <body> <p> <a href="myfile.html">My Page</a> <br /> <a href="myfile.html" onMouseover="window.alert('Hello');"> My Page</A> </p> </body> </html> JavaScript written inside HTML An Event docsity.com Example Statements <script language="JavaScript"> window.prompt('Enter your name:',''); </script> <form> <input type="button" Value="Press" onClick="window.alert('Hello');"> </form> Another event Note quotes: " and ' docsity.com HTML Forms and JavaScript • JavaScript is very good at processing user input in the web browser • HTML <form> elements receive input • Forms and form elements have unique names • Each unique element can be identified • Uses JavaScript Document Object Model (DOM) docsity.com Using Form Data Personalising an alert box <form name="alertform"> Enter your name: <input type="text" name="yourname"> <input type="button" value= "Go" onClick="window.alert('Hello ' +  document.alertform.yourname.value);"> </form> docsity.com Tips • Check your statements are on one line • Check your " and ' quotes match • Take care with capitalisation • Lay it out neatly - use tabs • Remember  in the workbook denotes a continuing line • Be patient docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved