JavaScript - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

JavaScript

Description:

script language='JavaScript' !-- hide. function openWin(URL) { aWindow = window.open(URL, 'composerwindow', 'toolbar=no, menubar=no, width=600, ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 11
Provided by: leehon
Category:
Tags: javascript | hide

less

Transcript and Presenter's Notes

Title: JavaScript


1
JavaScript
ltscript language"JavaScript"gt lt!-- hide function
openWin(URL) aWindow window.open(URL,
composerwindow, toolbarno, menubarno,
width600, height400, resizeyes ) //
--gt lt/scriptgt
2
JavaScript Syntax
  • ltscript type"text/javascriptgtlt!--script
    goes here//--gtlt/scriptgt

3
External Files
  • ltscript srcfilename.js type"text/javascript
    /gt

4
JavaScript Example
  • ltscript type"text/javascriptgt
  • lt!-- function openWin(URL)
  • aWindow window.open(URL, composerwindow,
    toolbarno, menubarno, width600, height400,
    resizeyes )
  • // --gt
  • lt/scriptgt

5
JavaScript Parts
Variable
Declaration
  • ltscript type"text/javascriptgt
  • lt!--
  • function openWin(URL)
  • aWindow window.open(URL, composerwindow,
    toolbarno, menubarno, width600, height400,
    resizeyes)
  • // --gt
  • lt/scriptgt

Argument
Function
String Arguments
6
Calling openWin Function
  • Open New Window within URL
  • lta hrefjavascriptopenWin(new.html)gtNew
    Pagelt/agt

7
JavaScript Events
  • Event - user actions that trigger a JS function.
  • Event handler - the trigger that launches a JS
    function whenever an event occurs.

8
JS Event Handlers
  • onClick
  • onDblClick
  • onKeyDown
  • onLoad, onUnload
  • onMouseDown, onMouseUp
  • onMouseOver, on MouseOut
  • onReset, onSubmit

9
Ex Status Line Rollover
  • lta hrefhttp//www.iastate.edu
    onMouseOverwindow.statusThe best land grant
    university in the country return truegtIowa
    Statelt/agt

10
HTML Examples
  • Inserting time and date (p. 322)
  • Image Swaps (p. 324)
  • Loading Images into Cache (p. 326)
Write a Comment
User Comments (0)
About PowerShow.com