User Interaction: jquery

Similar documents
TIME SCHEDULE MODULE TOPICS PERIODS. HTML Document Object Model (DOM) and javascript Object Notation (JSON)

JQUERY. jquery is a very popular JavaScript Library. jquery greatly simplifies JavaScript programming. jquery is easy to learn.

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Lesson 12: JavaScript and AJAX

,

AJAX: Introduction CISC 282 November 27, 2018

CS7026. Introduction to jquery

Creating an Online Catalogue Search for CD Collection with AJAX, XML, and PHP Using a Relational Database Server on WAMP/LAMP Server

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains an Individual and Group component

Session 18. jquery - Ajax. Reference. Tutorials. jquery Methods. Session 18 jquery and Ajax 10/31/ Robert Kelly,

Assigns a number to 110,000 letters/glyphs U+0041 is an A U+0062 is an a. U+00A9 is a copyright symbol U+0F03 is an

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

Outline. AJAX for Libraries. Jason A. Clark Head of Digital Access and Web Services Montana State University Libraries

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains 2 components

Static Webpage Development

iframe programming with jquery jquery Summit 2011

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

AJAX Workshop. Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries

CS50 Quiz Review. November 13, 2017

Programming in HTML5 with JavaScript and CSS3

Grading for Assignment #1

Nick Terkay CSCI 7818 Web Services 11/16/2006

ENRICHING PRIMO RECORDS WITH INFORMATION FROM WORDPRESS. Karsten Kryger Hansen Aalborg University Library

Multimedia im Netz Online Multimedia Winter semester 2015/16. Tutorial 07 Minor Subject

Working with Javascript Building Responsive Library apps

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

Programming in HTML5 with JavaScript and CSS3

AngularJS AN INTRODUCTION. Introduction to the AngularJS framework

Web Application Security

Welcome to CS50 section! This is Week 10 :(

User Interaction: XML and JSON

Course 20480: Programming in HTML5 with JavaScript and CSS3

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

Design Document V2 ThingLink Startup

Human-Computer Interaction Design

REST AND AJAX. Introduction. Module 13

Introduction to. Maurizio Tesconi May 13, 2015

AJAX. Lab. de Bases de Dados e Aplicações Web MIEIC, FEUP 2010/11. Sérgio Nunes

RKN 2015 Application Layer Short Summary

PHP / MYSQL DURATION: 2 MONTHS

CSCE 120: Learning To Code

XMLHttpRequest. CS144: Web Applications


XML Processing & Web Services. Husni Husni.trunojoyo.ac.id

a Very Short Introduction to AngularJS

CSC 337. jquery Rick Mercer

JavaScript Specialist v2.0 Exam 1D0-735

Web development using PHP & MySQL with HTML5, CSS, JavaScript

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

AJAX. Introduction. AJAX: Asynchronous JavaScript and XML

Homework 8: Ajax, JSON and Responsive Design Travel and Entertainment Search (Bootstrap/Angular/AJAX/JSON/jQuery /Cloud Exercise)

20480B: Programming in HTML5 with JavaScript and CSS3

PHP. MIT 6.470, IAP 2010 Yafim Landa

Los Angeles Cancer Surveillance Program. Links and Slides google Rich Pinder USC.

Programming in HTML5 with JavaScript and CSS3

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

Web applications design

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

Events & Callbacks (ESaaS 6.5)! 2013 Armando Fox & David Patterson, all rights reserved

Jquery Ajax Json Php Mysql Data Entry Example

Discussion #4 CSS VS XSLT. Multiple stylesheet types with cascading priorities. One stylesheet type

Part of this connection identifies how the response can / should be provided to the client code via the use of a callback routine.

Jquery.ajax Call Returns Status Code Of 200 But Fires Jquery Error

Getting Started with

AJAX: From the Client-side with JavaScript, Back to the Server

PHP Online Training. PHP Online TrainingCourse Duration - 45 Days. Call us: HTML

E ECMAScript, 21 elements collection, HTML, 30 31, 31. Index 161

Index. Ray Nicholus 2016 R. Nicholus, Beyond jquery, DOI /

Course Details. Skills Gained. Who Can Benefit. Prerequisites. View Online URL:

Create-A-Page Design Documentation

Sections and Articles

Comprehensive AngularJS Programming (5 Days)

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow

2/6/2012. Rich Internet Applications. What is Ajax? Defining AJAX. Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett

AJAX Programming Overview. Introduction. Overview

JavaScript, jquery & AJAX

Computer Security CS 426 Lecture 41

JQuery WHY DIDN T WE LEARN THIS EARLIER??!

Wakanda Architecture. Wakanda is made up of three main components: Wakanda Server Wakanda Studio Wakanda Client Framework


DevShala Technologies A-51, Sector 64 Noida, Uttar Pradesh PIN Contact us

Microsoft Programming in HTML5 with JavaScript and CSS3

In this project, you ll learn how to create your own webpage to tell a story, joke or poem. Think about the story you want to tell.

Prototype jquery. To and from JavaScript libraries. Remy Sharp (remysharp.com)

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services

Overview

Developing Ajax Web Apps with GWT. Session I

PHP & PHP++ Curriculum

DEVELOPMENT OF WEB BASED GIS APPLICATIONS USING ARCGIS SERVER API 3.X FOR JAVASCRIPT ONLINE TRAINING GIS. Course. Training. .com

ASP.NET AJAX adds Asynchronous JavaScript and XML. ASP.NET AJAX was up until the fall of 2006 was known by the code-known of Atlas.

AJAX: Rich Internet Applications

AJAX and JSON. Day 8

Learn Web Development CodersTrust Polska course outline. Hello CodersTrust! Unit 1. HTML Structuring the Web Prerequisites Learning pathway.

CL_55244 JavaScript for Developers

Development of Web Applications

JavaScript: the Big Picture

Frontend II: Javascript and DOM Programming. Wednesday, January 7, 15

Tooling for Ajax-Based Development. Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc.

AJAX ASYNCHRONOUS JAVASCRIPT AND XML. Laura Farinetti - DAUIN

Transcription:

User Interaction: jquery Assoc. Professor Donald J. Patterson INF 133 Fall 2012 1

jquery A JavaScript Library Cross-browser Free (beer & speech) It supports manipulating HTML elements (DOM) animations event handling AJAX

Getting access to jquery in our code You can t just write JavaScript that calls jquery You must load it From where? From your own machine http://jquery.com/ From someone else s machine From Google Why would you do this? http://code.google.com/apis/libraries/devguide.html Shortcut

Loading jquery is just like loading a remote JavaScript

Loading jquery is just like loading a remote JavaScript

w3schools With jquery you select HTML elements in the DOM and perform actions on them Basic syntax is: $(selector).action() A dollar sign ($) is used to define jquery $(selector).action() = jquery(selector).action() A selector to "query (or find)" HTML elements A jquery action to apply to the element(s)

w3schools <p class= foo >words</p> <p id= bar >more words</p> <p class= foo >even more words</p> <img class= foo /> Selection examples: multiple results $("p").hide() $(".foo").hide() $("p.foo").hide() single result $("#bar").hide() context dependent $(this).hide()

w3schools Possible Actions: append content to a DOM element wrap content around a DOM element toggle the display of a DOM element attach a function that is run when you hover over a DOM element you can request data via the ajax pattern

Loading jquery is just like loading a remote JavaScript Step 7

Loading jquery is just like loading a remote JavaScript Step 8

Loading jquery is just like loading a remote JavaScript Step 07_02: Is this an example of an AJAX pattern?

Assignment 4 Present the data as a table http://www.w3schools.com/html/html_tables.asp HTML tables overview 3 primary tags <table> <tr> <td>

Basic table <table> <tr> <td>

Assignment #4 Geocoded Feeds http://api.flickr.com/services/feeds/geo/ QDd_2PObCZ4ZsRM6Sw&format=json Use dynamic data, not static data jquery HTML Table AJAX request

Assignment 4 Two problems: Javascript does not allow you to make an XMLHttpRequest from an external domain XMLHttpRequest is the javascript function which retrieves data asynchronously Not just XML, but any data For security reasons it was restricted An http URL cannot request from an https URL and vice versa

Assignment 4 http://mydomain.com/index.html XMLHttpRequest http://mydomain.com/data.xml http://mydomain.com/index.html XMLHttpRequest http://mydomain.com/data.json http://mydomain.com/index.html XMLHttpRequest http://yourdomain.com/data.xml http://mydomain.com/index.html XMLHttpRequest http://yourdomain.com/data.json

Assignment 4 Solutions to the cross-domain security restriction Run a proxy a php proxy You request http://mydomain.com/proxy.php?http:// yourdomain.com/data.xml Javascript thinks its coming from local server proxy.php contains something like this code: php doesn t run on ics.uci.edu You need to use students.ics.uci.edu http://www.ics.uci.edu/computing/web/ faqs.php#students

Assignment 4 This is the contents of a file on your server It is running a language called php the language is interpreted by your web server code Browser proxy Data Requests data via AJAX call Forwards request to foreign domain

Assignment 4 Solutions to the cross-domain security restriction Use JSONP Requires server support Yahoo APIs support this Leverages Javascript loophole XMLHttpRequests are restricted Remote Javascript is not

Assignment 4 JSONP adds a <script src=> element to your web page with the external URL as the src target Getting JSON looks like this: Request: http://yourdomain.com/data.json Return: { hello : world } Getting JSONP looks like this: Request http://yourdomain.com/data.jsonp?callback=mycallback Return: mycallback( {\ hello\ :\ world\ } ) Your webpage writes a function called mycallback to deal with the data

Assignment 4 My Javascript $ajax(url, callback) function callback(data){ parse data insert into HTML table } Browser Proxy url data (JSON/XML) GeoData Data My HTML <head> jquery script my javascript </head> Requests javascript via AJAX call <body> <table> Here be a table! </table> </body>

Assignment 4 Security issue You are running server generated code on your machine!

What if you have something other than JSON to load? XML Where can I find info about jquery actions? jquery API Reference for example, html() vs text() vs append()?

- Final example Step14

- XML

- JSON

- JSONP