1 / 21

IM 215 Intro to Scripting Languages

IM 215 Intro to Scripting Languages. Objectives. The core objectives of this course are as follows: Students will understand basic foundations of JavaScript, including its usage in the web and application design and development.

cleta
Download Presentation

IM 215 Intro to Scripting Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IM 215Intro to Scripting Languages

  2. Objectives The core objectives of this course are as follows: • Students will understand basic foundations of JavaScript, including its usage in the web and application design and development. • Students will understand basic foundations of Flash/ActionScript, including its usage in the web and application design and development. • Students will understand the foundations of mobile applications development.

  3. Academic policies • Lab use • Communication about grades • Academic honesty • Exam and quiz policy • Late work

  4. Assessment criteria • Assessments:Class participation - 4 Quizzes – 25 points eachJavascript Assignment 1 – 40 pointsJavascript Assignment 2 – 40 pointsJavascript Assignment 3 – 50 pointsActionscript Assignment 1 – 20 pointsActionscript Assignment 2 – 25 pointsActionscript Assignment 3 – 35 pointsActionscript Assignment 4 – 50 pointsFinal Exam – 100 points

  5. Grades/Resources >= 90% A Excellent >=80% and < 90% B Above Average >=70% and < 80% C Average >=60% and <70% D Below Average < 60% F Fails Javascript, A Beginner’s Guide, 3rd Edition by John Pollock Foundation Actionscript 3.0 by Yard, Webster and McSharry

  6. Contact details Email: mtovey@bumail.bradley.edu AIM: marktee07 Twitter: em_tee After lectures on Monday’s and Wednesday’s

  7. Javascript Introduction

  8. Javascript • Adds interactivity and effects to a static HTML page • Limited to client side actions • Wikipedia.com – no javascript interactions • Amazon.com – significant javascript enhancements

  9. First steps.. • Tools of the trade • A text editorTextWrangler (http://www.barebones.com/products/TextWrangler/)Notepad++ (http://notepad-plus.sourceforge.net/uk/site.htm) • A browserFirefox (current version 3.5.7)Internet Explorer (version 7) • Edit code in your text editor • When ready to try your code, open in the browser

  10. Simple HTML page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN“ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Simple static page</title> </head> <body> <p>IM215 rocks</p> </body> </html>

  11. First script Add the following to our page: <script type=“text/javascript”>document.write(‘<p>And so does Javascript</p>’); </script> Save the page and re-open it in your browser.

  12. External script Create a new file and insert the following line: document.write(‘<p>Written in from outside</p>’); Save it as external.js Return to our original html file and insert the following: <script type=“text/javascript” src=“external.js”></script>

  13. Variables Variables are containers for data datum – individual piece of data name - label that identifies the piece of datum variable – consists of a name and a piece of data A variable’s datum is called its “value”

  14. Variables (cont.) Simplify code and save time, giving commonly referenced values a single name Acts as a placeholder for unknown values, e.g. user input Clarifies code, allowing you to give meaningful names to values used in code

  15. Using Variables Defining:var variableName; Giving, or “Assigning”, a value: variableName=25;Or, combined:var variableName=25;

  16. Variable rules Variable names are case sensitive. Can only contain letters, numbers or underscores. Cannot begin with a number. Cannot be one of a set of Javascript reserved words. Use meaningful names.

  17. Variable Data Types • The current value of a variable has a “type” • Javascript has 3 core data types • Number – Any number including decimal numberse.g. var numVar=25; • String – any sequence of characterse.g. var stringVar=“A string of text”; • Boolean – true or false

  18. Using Variables To reference a variable, include the name in the context of other code. For example,var ourString=“An assigned string”;document.write(ourString);

  19. Comments Lines in code that get ignored by the JavaScript engine. Provide clarity, allowing you to explain the overall purpose of your code in plain english. Valuable when collaborating on code with others, and for your own future reference.

  20. Comments • Single line:// This line is a comment • Multi-line:/*This is a multi-line commentEverything within here is ignored*/

  21. Sources: “JavaScript: A Beginner’s Guide” by John Pollock

More Related