• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Feltman js4 vfp
 

Feltman js4 vfp

on

  • 795 views

The Javascript session I meant to upload

The Javascript session I meant to upload

Statistics

Views

Total Views
795
Views on SlideShare
794
Embed Views
1

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 1

http://131.253.14.98 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Feltman js4 vfp Feltman js4 vfp Presentation Transcript

    • JavaScript for FoxPro Developers Mike Feltman F1 Technologies
    • Who Am I? President F1 Technologies since 1990 Co-author Visual FoxExpress Consultant Xbase Developer since dBase III/FoxBase 1987 Web Developer since 1994 JavaScript for about 2-3 years
    • Agenda Why JavaScript? VFP vs. JavaScript JS Basics JS Syntax & VFP Concordance JS OOP AJAX w/ VFP
    • Why JavaScript? Web 2.0 Great way to take VFP Skills to the Web In demand Cross-Platform Relatively easy for VFP Developers to pick up
    • CapabilitiesVFP JavaScript  Access to File System  No File System Access  Database Engine  Can’t read or write to files on server  Network access limited only by network security  Can’t read or write to files on client  Hundreds of commands & functions  No network access  Cannot access pages on another domain  Around 50 command and functions
    • Runtime EnvironmentVFP JavaScript  Operating System:  Operating System:  Windows  Windows, MAC, Linux, Version: Unix, etc.  VFP Compiler Version Version:  Browser Controlled: Firefox, Safari, Chrome, IE, Opera, etc.  1.5 current “standard”
    • Development EnvironmentVFP JavaScript  Designers: Editor,  Designers: n/a, Requires 3rd Form Class Designer, Party tools. No definitive Report Write, Class IDE Browser, etc. built-in.  Debugger: virtually nothing native. Varies by browser,  Debugger: Integrated Firebug for Firefox and debugger, with Trace, Debugbar for IE. Watch, Locals, Output,  JavaScript Console various Call Stack other Command Window  Command Window like utilities.
    • Language FeaturesVFP JavaScript  Dynamically Typed  Dynamically Typed  Case Insensitive  Case Sensitive  “Second Class” Functions  First Class Functions  No Nested Functions  Nested Functions  Compiled or Interpreted  Interpreted  Procedural  Procedural  OOP: Class Based  OOP: Prototype based  “1 based”  “0 based”
    • SyntaxVFP JavaScript  Line Terminator:  Line Terminator: semi- carriage return colon  Line Continuation:  Line Continuation: n/a semi-colon
    • Math OperatorsFunction VFP JavaScriptAddition + +Subtraction - -Multiplication * *Division / /Modulus MOD() %Unary addition x=x+1 x++Unary subtraction x=x-1 x--
    • Assignment OperatorsFunction VFP JavaScriptEquality = =Addition n/a +=Subtraction n/a -=Multiplication n/a *=Division n/a /=Modulus n/a %=
    • Comparison OperatorsFunction VFP JavaScriptEquality =,== ==Greater than >, >= >, >=Less Than <, <= <, <=Identical & of n/a ===Same TypeNot Identical !=,!==,<> !==Inline IF IIF() (condition)?true value: false value
    • Logical OperatorsFunction VFP JavaScriptAnd AND &&Or OR ||Not NOT, ! !
    • Data TypesVFP JavaScript Character, Memo, String, Numeric, Numeric, Memo, Boolean, Object, Array Integer, Currency, Float, Double, Data, DateTime, Object, Screen, General, Logical, Blob, Array
    • Constructs: IfVFP: JavaScript: IF <expr> if (logical expression) statement(s) {statement(s)} ELSE else if (logical statement(s) expression) ENDIF {statements} else {statement(s)}
    • Constructs: WhileVFP JavaScript DO WHILE expression while (expression) statement(s) { ENDDO statement(s) } EXIT break LOOP continue
    • Constructs: ForVFP JavaScript FOR var = n to n STEP n for statements (var=startvalue;var<= ENDFOR endvalue;var=var+inc rement) { statement(s) }
    • Constructs: CASEVFP JavaScript DO CASE switch (expression) CASE condition { case value: statements statement(s) OTHERWISE break; statements default: ENDCASE statement(s) }
    • VFP JavaScript Event ConcordanceJavaScript VFP onabort n/a onblur lostfocus onchange interactivechange onclick click ondblclick dblclick onerror ON ERROR, Error onfocus gotfocus onkeydown, onkeyup keypress
    • VFP JavaScript Event ConcordanceJavaScript VFP onload load, init onmousedown mousedown onmousemove mousemove onmouseout mouseleave onmouseover mouseenter onmouseup mouseup onreset n/a
    • VFP JavaScript Event ConcordanceJavaScript VFP onresize resize onselect n/a onsubmit n/a onunload unload
    • Event BindingVFP JavaScript Inline Inline BindEvents() document.observe() .addEventListener(‘ev ent’,function,false)
    • OOPVFP JavaScript Class Based Prototype based Objects are instances of Objects are based on a classes prototype
    • Object ModelVFP JavaScript _SCREEN DOM (Document Object _VFP Model) document window Browser Dependent
    • Using External CodeVFP JavaScript SET PROCEDURE <script … src=‘file SET CLASS LIBRARY name’>
    • 3rd PartyVFP JavaScript (all free)  Only 1 good Prototype & framework Script.aculo.us (&  Sort of expensive (but scripteka.com) well worth it – really) JQuery YUI (Yahoo User Interface) Adobe Spry Google
    • JavaScript Resources JavaScript  http://javascript.crockford.com/  The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks (Sitepoint.com)  http://www.javascript.com/  http://javascript.internet.com/  http://www.javascriptkit.com/  http://www.w3schools.com/jsref/default.asp Prototypejs.org  Prototype and script.aculo.us: You never knew JavaScript could do this! (PragProg.com)  Script.aculo.us
    • Conclusion JavaScript is a flexible, powerful language JavaScript should be easy for VFP developers to learn Free 3rd Party Tools make JavaScript much easier
    • Thank You Mikefeltman at f1tech dot com http://www.f1tech.com http://f1technologies.blogspot.com/ 419-255-6366