ALBERT WAVERING BOBBY SENG. Week 5: More JavaScript  Quiz  Announcements/questions.

Slides:



Advertisements
Similar presentations
JavaScript – Quiz #8 Lecture Code:
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
1 COMM 1213 H1 COMP 4923 X1 JavaScript 1 (Readings: Ch. 10, 11 Knuckles)
The jQuery library. What is jQuery ? A javascript lightweight library Is very easy to use Is powerful Is cross-browser compatible Downloadable from jQuery.com,
JQuery CS 380: Web Programming. What is jQuery? jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling,
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
JavaScript Objects Objects – JavaScript is an object-based language Has built-in objects we will use – You can create your own objects We concentrating.
JQuery. What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversing and manipulation event handling.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
By Jon Marozick.  JavaScript toolkit  Aims to change the way developers think  jQuery philosophy  Find some HTML  Do something to it.
Tutorial 14 Working with Forms and Regular Expressions.
Scripting Languages.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
JavaScript Lecture 6 Rachel A Ober
DOM and JavaScript Aryo Pinandito.
JQuery Adding behaviour…. Lecture Plan Review of last lesson Adding behaviour –click, mouseover Animation –fade, slideDown Navigation –parent, find, next.
The Web Wizard’s Guide To JavaScript Chapter 6 Working with Dates and Times.
Review IDIA 619 Spring 2013 Bridget M. Blodgett. HTML A basic HTML document looks like this: Sample page Sample page This is a simple sample. HTML user.
Working with background, images and date object Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
JavaScript. Overview Introduction: JavaScript basics Expressions and types Expressions and types Arrays Arrays Objects and Associative Arrays Objects.
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Lecture 9 The Basics of JavaScript Boriana Koleva Room: C54
Animation & Effects Using JQuery. What is jQuery? jQuery is a lightweight, JavaScript library. The purpose of jQuery is to make it much easier to use.
. Taught by: Muhammad Ali Baloch midahot. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between.
ALBERT WAVERING BOBBY SENG. Week 4: JavaScript  Quiz  Announcements/questions.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
LOGO sparcs.org 1 jQuery Tutorial Presenter ㅎㅇㅎㅇ.
ALBERT WAVERING BOBBY SENG. Welcome  Introductions  Existing knowledge?  Laptops?  Course goals  Introduction to several topics  Encourage creativity.
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
Web Programming Language Week 9 Dr. Ken Cosh Introducing jQuery.
Unit 11 –Reglar Expressions Instructor: Brent Presley.
Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.
IS2802 Introduction to Multimedia Applications for Business Lecture 07: Introduction to jQuery Rob Gleasure
Tutorial 11 1 JavaScript Operators and Expressions.
Introduction to JQuery COGS 187A – Fall JQuery jQuery is a JavaScript library, and allows us to manipulate HTML and CSS after the page has been.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Chapter 9. An event-driven, object-based programming language that provides various types of functionality to pages. Object based: it is a language that.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
.. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between HTML and JavaScript. The jQuery library.
Basic Objects. Math Object  Math.cos( x ), x in radians  Math.sqrt ( x )  Math.pow ( x, y )  Math.ceil( x )  etc.
Chapter 4 Java Script – Part2. 2 Location object Properties Properties href – whole path will be displayed. ex: window.location.href ( see example 11)
JQuery.
Introduction to.
Applied Component I Unit II Introduction of java-script
CS 330 Class 7 Comments on Exam Programming plan for today:
CS5220 Advanced Topics in Web Programming JavaScript and jQuery
JQUERY Online TRAINING AT GOLOGICA
SEEM4570 Tutorial 05: JavaScript as OOP
14 A Brief Look at JavaScript and jQuery.
..
An Introduction to Animation
Javascript and JQuery SRM DSC.
An introduction to jQuery
Chengyu Sun California State University, Los Angeles
Getting started with jQuery
Presentation transcript:

ALBERT WAVERING BOBBY SENG

Week 5: More JavaScript  Quiz  Announcements/questions

Built-in JS Objects  Boolean (true or false)  String  Array  Math  Date  Regular Expression

Boolean  var iWin = new Boolean(); = new Boolean(1); = new Boolean (0); = new Boolean(true); = new Boolean(false);

Boolean Values  True  1 (or any nonzero number)  true  "anything goes here"  False  0  false  ""

String  Built-in functions:  String.lengthevaluates to length of string  String.toUpperCaseall characters to upper case  String.toLowerCaseall characters to lower case  String.charAtreturns character at index  String.concatcombines two strings (like +)  String.splitarray elements divided on a match  String.substring returns a subset of characters  String.match replace, search: Reg Exp functions

String var myPhrase = "Four score and seven years ago"; myPhrase.charAt(3); myPhrase.substr(5,9); myPhrase.split(" "); myPhrase.toUpperCase();

String myPhrase.charAt(3)'r' myPhrase.substr(5,9);'score' myPhrase.toUpperCase();"FOUR SCORE AND SEVEN YEARS AGO" var myArray = myPhrase.split(" "); myArray = ["Four","score","and","seven","years", "ago"] (this is an array of size 6)

Array  var myArray = new Array();  myArray[0] = 5; my2DArray[1][2] = 8;  document.write(myArray[1])  Built-in functions:  concatcombine two or more arrays  popremoves last element  pushadds element to end of array  shiftremoves first element of array  unshiftadds element to beginning of array  reversereverses order of elements

Math  Constants  Math.E  Math.PI  others  Methods  Math.round  Math.random  Math.floor  Math.ceil  Math.cos, sin, tan  Math.sqrt  Math.pow

Date  var myDate = new Date(); //current date, time  Date(ms) = milliseconds since 1/1/1970  Date(dateString) = interprets dateString  Date(y, m, d, h, m, s, ms) = input specific numerals  Comparation  Less than, greater than (after, before)  Methods  getFullYear, getMonth, getDay, getDate  getHours, getMinutes, getSeconds, getMilliseconds, getTime

Regular Expressions  Used to evaluate regular languages  Create patterns to match specific occurrences in strings  Can use to replace, separate, and locate text  var myRegEx = /pattern/modifiers  Example  var myRegEx = /[A-Za-z0-9]/g  Look online for specific pattern and modifier syntax (won’t quiz you on this)

So how is this useful?!  Form Submission  Dynamic Content  Functionality  Web Applications

JS: Making Things Happen  We want to interact with HTML of page  Specifically, elements  To do any sort of action (read, change, etc) an element or group of elements, we need to select it/them  Selection tools  document.myFormName.elementName  document.getElementByID("myElementID")  DON’T USE THESE

JS: Selecting Elements  First brick wall with interoperability  Element selection is not universal across IE 6-9, Firefox, Chrome, and Safari  Handle each case?  Heck no  jQuery  JavaScript ‘library’  Suite of tools that are very useful for JS developers

jQuery   Element selection  User interface elements  Event handling  Animation  AJAX data transfer

jQuery  Currently 24kb   Include this library if you’re using jQuery, but reference it from your own server   jQuery operations make use of the $ variable

Back to Reality  Element selection in jQuery  $("*")selects all elements  $("#myID")selects element with ID myID  $(".myClass")selects elements of class myClass  $("anElement") selects elmnts of type anElement  Many more, check documentation for examples $(“#albert”).attr()

jQuery: Attributes .addClass .attr .hasClass .html .removeClass .val

jQuery: Traversing .children .each .next .parent .siblings

jQuery: Manipulation .append .height .position .remove .replaceWith .text

jQuery: CSS  All similar functions we already covered

jQuery: Events .bind,.unbind .click .dblclick .focusin,.focusout .keydown,.keyup,.keypress .mouseenter,.mousemove,.mouseleave,.mouseout,.mouseover .ready .select .scroll .toggle

jQuery: Effects .animate .delay .fadeIn,.fadeOut .hide,.show .slideDown,.slideUp .stop .toggle

jQuery: AJAX .ajaxSend,.ajaxError,.ajaxComplete .ajaxStart,.ajaxStop,.ajaxSuccess  jQuery.get, jQuery.getJSON, jQuery.getScript .load .post .serialize

Homework  Create a webpage composed of the following: one HTML page that includes a form with text areas, a checkbox, and a button. In a linked.js file, use jQuery to make the entered information appear elsewhere on the page. For examples, check the jQuery documentation. jQuery documentation.  You will need to link the jQuery library before any jQuery commands you try to run:  Download a copy of jQuery from Your homework must pass W3C validation. Don't worry about ing a copy of jQuery with your homework - we've got our own copy ;)