Prototype.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Advertisements

Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Fawaz Ghali AJAX: Web Programming's Toy.
1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
Cascading Style Sheets
AJAX (Asynchronous JavaScript and XML) Amit Jain CS 590 – Winter 2008.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
JQuery CS 268. What is jQuery? From their web site:
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
WORKING WITH NAMESPACES
1 Ajax. 2 What’s Ajax? AJAX is a combination of a few technologies that has come together in the past few years AJAX used to be an acronym for Asynchronous.
JavaScript Libraries: Prototype.js. Get it at:
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
AJAX Making Dynamic Web pages more Dynamic Jim Hendricks April 25th, 2006.
Matrix Mapping Tool Sam Gross Internship at Virtual Technology Corporation.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
JavaScript – The DOM JavaScript is object based The browser is object based – We can access the browser's objects in the same way we did JavaScript's Two.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Prepared for Search Engine Strategies - Chicago Copyright 2006 Critical Mass, Inc. All Rights Reserved Page 1 Search Engine Strategies Chicago ‘06 AJAX.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Dimiter Kunchev.  JavaScript library written by Sam Stephenson   Adds object oriented techniques  Provides.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
CSCI 6962: Server-side Design and Programming Master Pages.
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
the acronym for Asynchronous JavaScript and XML.
Creating Dynamic Webpages
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Ajax VS Flex A comparison based on shopping cart implementation PoHsu Yeh py2157.
IT533 Lectures ASP.NET AJAX.
Lesson 16. Practical Application 1 We can take advantage of JavaScript and the DOM, to set up a form so that the first text box of a form automatically.
AJAX. Overview of Ajax Ajax is not an API or a programming language Ajax aims to provide more responsive web applications In normal request/response HTTP.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
CSS Positioning & Layout Creating layouts and controlling elements.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
AJAX in Ruby-on-Rails. Ruby on Rails and AJAX AJAX can be done with just Javascript Easier if you use libraries –Prototype –SAJAX –jQuery Libraries only.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
Chapter 6 Murach's JavaScript and jQuery, C6© 2012, Mike Murach & Associates, Inc.Slide 1.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
XML DOM Week 11 Web site:
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Unit 4 Representing Web Data: XML
Not a Language but a series of techniques
Introduction to Google Tag Manager
AJAX and REST.
Subbu Allamaraju BEA Systems Inc
AJAX.
JavaScript Using JavaScript.
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
JavaScript Introduction
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
DWR: Direct Web Remoting
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
Ajax on Rails 28-Nov-18.
© 2015, Mike Murach & Associates, Inc.
JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS
Chengyu Sun California State University, Los Angeles
AJAX Chapters 19, 20.
Web Client Side Technologies Raneem Qaddoura
Murach's JavaScript and jQuery (3rd Ed.)
JavaScript and the DOM MIS 2402 Maxwell Furman Department of MIS
Presentation transcript:

Prototype

Prototype This is what happens when a smart Ruby programmer plays with JavaScript Created by Sam Stephenson http://prototype.conio.net Makes JavaScript some what Ruby like Additional convenience methods, etc. Makes DOM much simpler to navigate Manages browser differences

Clone() copies class/object Extend We discussed about inheritance in JavaScript Prototype provides an extend method Copies properties from one to another Clone() copies class/object

Ruby like functions for in Java iterates over object properties Ruby’s each iterator would be nice! Closure can perform tasks on the elements of a collection More Ruby like functions added

DOM Simplified DOM is powerful, but awfully painful Prototype helps by providing a number of convenience methods Somewhat cryptic, but darn good

$() Method Takes all kinds of things Id represented by String a DOM node Adds some interesting Ruby like methods to DOM element So you can iterate over, …

$$() Method Allows you to select (and iterate) over elements identified by Tag name CSS Class name Id

Insertion Given an ID, insertion allows you to insert content Before (above) Top (top within) Bottom (bottom within) After (below) the content

Using $() and Insertion

Using $() and Insertion…

Ajax Calls Prototype’s provides a “class” called Ajax that takes care of several things related to Ajax Browser idiosyncrasies Goes to the extent of: Making the remote call Helps you with return codes Remember the hideous status ids Allows you to perform actions when call complete

Help with XMLHttpRequest XMLHttpRequest object implementation is across browsers We saw how to write code to deal with these differences Prototype hides this for you

What we saw earlier

Prototype’s solution beautiful!

What’s that Try.these?

Defining success and failure

Ahem, but how do I make a remote call? Ajax.Request helps with that But, what’s that Class.create()?

Class.create() Earlier we saw how to create classes in JavaScript Prototype adds convenience to create a class

Ajax.Request

Making Asynchronous Call

Making Asynchronous Call…

Making Asynchronous Call…

Pretty cool, but can be simpler! Ajax.Updater extends Ajax.Request Updates a section of page (typically an id for a div tag) with returned content PeriodicalExecuter can keep polling the server at specified interval