Using jQuery Dr. Charles Severance www.php-intro.com.

Slides:



Advertisements
Similar presentations
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
Advertisements

Video, audio, embed, iframe, HTML Form
What is it? –Large Web sites that support commercial use cannot be written by hand What you’re going to learn –How a Web server and a database can be used.
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.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
M. Taimoor Khan Courtesy: Norman White.
Intro to JavaScript Events. JavaScript Events Events in JavaScript let a web page react to some type of input Many different ways to handle events due.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
UFCEWT-20-3 Advanced Topics in Web Development Lecture 4 : JavaScript, Browsers & the HTML DOM-API.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 13 - Frameworks Modern JavaScript Design And Develop Copyright © 2012 by Larry Ullman.
HTML: Tables & Frames Internet Technology.
Javascript Intro
Where does PHP code get executed?. Where does JavaScript get executed?
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Web Design: Basic to Advanced Techniques Fall 2010 Mondays 7-9pm 200 Sutardja-Dai Hall Introduction to PHP.
Computer Science and Software Engineering© 2014 Project Lead The Way, Inc. HTML5 Evolving Standards JavaScript.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
Introduction to Dynamic Web Content Dr. Charles Severance
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
JavaScript Library. What is jQuery jQuery is a lightweight JavaScript library. The purpose is to make it easier to use JavaScript code on your website.
Event-Driven Programming Chapter Page Section: Section or division of an HTML page Generic block element Example: What's the difference between.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
Web Programming Language Week 9 Dr. Ken Cosh Introducing jQuery.
Using jQuery / APIs / JSON Dr. Charles Severance
JQuery and AJAX WEB Technologies : PHP Programming Language.
JavaScript Dr. Charles Severance
Web Technologies Lecture 8 JQuery. “A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Forms and PHP Dr. Charles Severance
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Overview Web Technologies Computing Science Thompson Rivers University.
Javascript AJAX HTML WEB SERVER Asynchronous. Javascript HTML events DOM – document object model browser internal view of html page compute.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
Using Handlebars Dr. Charles Severance
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Shaun Geisert Matt Trice. What is jQuery?  Open source Javascript library/framework Created by John Resig  Their tagline – “The Write Less, Do More.
Introduction to Dynamic Web Content Dr. Charles Severance
Java Script and the DOM DOM stands for: –The Document Object Model When a browser reads a web page, it converts it’s contents from HTML into a hierarchical.
Dr. Charles Severance Using Handlebars Dr. Charles Severance
Introduction to Dynamic Web Content
Our Technologies Dr. Charles Severance
Web Technologies Computing Science Thompson Rivers University
Programming Web Pages with JavaScript
JavaScript Dr. Charles Severance
Tek Raj Chhetri Code for Humans not for machine.
Using JSON Dr. Charles Severance
Introduction to Web programming
JQUERY Online TRAINING AT GOLOGICA
HTML.
Understanding JavaScript and Coding Essentials
Web Browser server client 3-Tier Architecture Apache web server PHP
Introduction to Dynamic Web Content
Using jQuery Dr. Charles Severance
Document Object Model (DOM): Objects and Collections
..
MIS JavaScript and API Workshop (Part 2)
Ajax with XML 23-Feb-19.
Ajax with XML 27-Feb-19.
Getting started with jQuery
E-commerce Applications Development
Web Technologies Computing Science Thompson Rivers University
Client-Server Model: Requesting a Web Page
Murach's JavaScript and jQuery (3rd Ed.)
JavaScript and the DOM MIS 2402 Maxwell Furman Department of MIS
Presentation transcript:

Using jQuery Dr. Charles Severance

Web ServerDatabase Server Time Apache PHP MySql Browser JavaScript DOMDOM PDOPDO Parse Response Parse Request

Document Object Model JavaScript can manipulate the current HTML docment The “Document Object Model” tells us the syntax to use to access various “bits” of the current screen to read and/or manipulate You can even find pieces of the model by id attribute and change them We can read and write the DOM from JavaScript del

DOM's are not Identical Not all browsers represent their page exactly the same. This makes it a challenge to keep all of your JavaScript working on all browsers Also means you need to test your code over and over on each browser Aargh..

jQuery to the rescue While the DOM's are not particularly portable, and direct DOM manipulation is a little clunky, there are a number of JavaScript frameworks that handle the myriad of subtle differeces between browsers With jQuery, instead of manipulating the DOM, we use jQuery functions and everything works much better...

John Resig Started jQuery in 2005 to make his web development projects easier Elegant way to select DOM elements Clean way to register events Released in 2006 Works at Khan Academy as the "Dean of Computer Science"

jQuery Documentation The web is a wonderful source of jQuery documentation

jquery- 01/hello.php Here is some awesome page content $(document).ready(function(){ alert("Hello jQuery World!"); window.console && console.log('Hello jQuery..'); });

ze/ jquery- 01/resize.php $(window).resize(function() { console.log('.resize() called. width='+ $(window).width()+' height='+$(window).height()); }); Here is some awesome page content

jquery-01/toggle.php Where is the spinner? <img id="spinner" src="spinner.gif" height="25" style="vertical-align: middle; display:none;"> <a href="#" onclick="$('#spinner').toggle(); return false;">Toggle <a href="#" onclick="$('#para').css('background-color', 'red'); return false;">Red <a href="#" onclick="$('#para').css('background-color', 'green'); return false;">Green

jquery-01/autopost.php <input type="text" name="one" value="Hello there" style="vertical-align: middle;"/> <img id="spinner" src="spinner.gif" height="25" style="vertical-align: middle; display:none;">... <?php sleep(5); echo('You sent: '.$_POST['val']); jquery-01/autoecho.php

jquery-01/autopost.php $('#target').change(function(event) { $('#spinner').show(); var form = $('#target'); var txt = form.find('input[name="one"]').val(); window.console && console.log('Sending POST'); $.post( 'autoecho.php', { 'val': txt }, function( data ) { window.console && console.log(data); $('#result').empty().append(data); $('#spinner').hide(); } ).error( function() { $('#target').css('background-color', 'red'); alert("Dang!"); }); });