Microsoft PowerPoint - Very quick guide to JavaScript for Java …

Microsoft PowerPoint - Very quick guide to JavaScript for Java ...Short Description
Very quick guide to JavaScript. for Java programmers. Mark Dunlop. 2/8. Basics. . Often interacts with forms. - Checks forms before submission …

Website: www.cis.strath.ac.uk | Filesize: 105kb

Content
Very quick guide to JavaScript
for Java programmers
Mark Dunlop
2/8
Basics
?Often interacts with forms
- Checks forms before submission
- Automatically completes/calculates fields
?Dynamic typing => no type statements
?Like Java . is used for separating parts of a
variable e.g. object.field
3/8
Example field completion
function init(form) {
// puts the date (in non-US format into the date field of form
date = new Date();
form.date.value=date.getDate()+”/”+
(date.getMonth()+1)+”/”+date.getFullYear();
}
?to call add info to body tag of HTML page and to form tag

4/8
Functions
?Functions replace methods in typical
JavaScript these are non-OO
?They do not specify a return type nor the type
of parameters
?Return clauses are optional5/8
Function Example
function addHello(myName){
if (myName==”")
return (”Hello friend”);
else
return (”Hello”+myName);
}
6/8
Simple user interaction
?window.alert(String)
?Boolean window.confirm(String)
?String window.prompt(String)
7/8
Submission example
function checkUserIsHappy(message){
return (window.confirm(message));
}
?add to submit input tag

onclick='return checkUserIsHappy("About to delete all");'>
Note quotes!
Use careful wording - you get OK/Cancel with OK as default
8/8
Java Damage…

Get the file Download here

AddThis Social Bookmark Button
Related Books:
  • Java Programming Guide - Quick Reference 1999 Pinnacle Software
  • Microsoft PowerPoint - Java-Basic-Syntax.ppt
  • Microsoft PowerPoint - Ajax Programmingppt
  • Microsoft PowerPoint - Java I18N Tutorial (lecture)
  • Microsoft PowerPoint - Java RMI EJB Tutorial.pps
  • Andy’s JavaScript Tutorial
  • Java Plug-in 1.4.2 Developer Guide Contents
  • Introduction to JavaScript

  • Related Searches: , , , ,



    Comments

    Leave a Reply




    Search engine terms: java quickguide,