Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming for the Web JavaScript Basics Dónal Mulligan BSc MA

Similar presentations


Presentation on theme: "Programming for the Web JavaScript Basics Dónal Mulligan BSc MA"— Presentation transcript:

1 Programming for the Web JavaScript Basics Dónal Mulligan BSc MA donal.mulligan@dcu.ie

2 What’s JavaScript It isn’t Java! It’s a client-side, web-based programming language. – Mocha -> LiveScript -> Javascript – Developed from ECMAScript (scripting structure specified in 1997 by standards agency ECMA International) JavaScript J Script ActionScript

3 Caveats: JavaScript may be turned off Browser may not support JavaScript or the version you are using User platform (PDA or phone) may not handle it Accessibility issues – screen readers

4 So... Always degrade gracefully Consider alternative delivery Be aware of browser inconsistencies But be secure: – Sandbox – Never include passwords – Validation not correction

5 Variables Container for data ‘var’ keyword Assignment - using the '=' sign var $my_favourite_colour = “blue“; Name with: letters, numbers and underscores No spaces or punctuation characters Any length Case sensitivity $VARIABLE != $variable Meaningful variable names

6 Variable data types Numbers $a_numerical_value = 5; Strings $a_string_variable = "Hello, world!“; $a_string_variable = ‘Hello, world!’; Boolean $a_boolean_variable = true; $a_boolean_variable = false; $a_boolean_variable = 0; Null

7 Some event handlers onmouseover – Hover (enter the boundary of the element) onmouseout – Hover (exit the boubdary of an element) onfocus - A form element is selected onblur – A selected form element is unselected onclick onkeypress


Download ppt "Programming for the Web JavaScript Basics Dónal Mulligan BSc MA"

Similar presentations


Ads by Google