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

Slides:



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

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 8- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 6- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 2- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 9- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 18 Indexing Structures for Files.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 2 Application Layer. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 2-2.
© 2010 Pearson Education, Inc. All rights reserved.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object, Object- Relational, and XML: Concepts, Models, Languages,
Copyright © 2005 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
© 2010 Pearson Education, Inc. All rights reserved.
© 2010 Pearson Education, Inc. All rights reserved.
Copyright © 2005 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2008 Pearson Education, Inc. Chapter 13 The Trigonometric Functions Copyright © 2008 Pearson Education, Inc.
Chapter 6 Human Capital. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 6-2.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2005 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 16 Resources and the Environment at the Global Level.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Part 1 Conditionals and Loops.
© 2010 Pearson Education, Inc. All rights reserved.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
JavaScript & jQuery the missing manual Chapter 11
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11.9 Curvature and Normal Vectors.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Limits.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 Sequences and Infinite Series.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Chapter 15 © 2009 by Addison Wesley Longman, Inc Overview of Rails - Rails is a development framework for Web-based applications - Rails is written.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11.5 Lines and Curves in Space.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 4 Applications of the Derivative.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Functions.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 Integration.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Vector Calculus.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 5 Integration.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11.6 Calculus of Vector-Valued Functions.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Integration.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4.8 Antiderivatives.
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.
Understanding JavaScript and Coding Essentials Lesson 8.
AJAX Use Cases for WSRP Subbu Allamaraju BEA Systems Inc WSRP F2F Meeting, May 2006.
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
JQuery.
Play Framework: Introduction
Subbu Allamaraju BEA Systems Inc
Ajax on Rails 28-Nov-18.
© 2015, Mike Murach & Associates, Inc.
Presentation transcript:

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

16-2 Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16.3 Rails with Ajax The prototype JavaScript library is integrated into Rails Rails and Ajax have some limitations Not all elements can be modified, depending on the browser The div element can be modified Rails and Ajax process Sequence is triggered Data is sent asynchronously to an action handler The action handler creates a response JavaScript in the browser interprets the response

16-3 Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16.3 The Initial Form Document The popcorn example is used here, with the zip code helper The show_form action and document show_form.rhtml are the first contact, providing the form

16-4 Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16.3 Triggering Ajax Ruby provides methods to set up triggers for Ajax processing link_to_remote triggers when a link is activated observe_field is triggered when a widget is changed Method observe_field Takes the name of the widget as a first paramater Several ‘keyword’ parameters :url where to post, often associated with an :action symbol definition :update associated to the id of the elment whose value is to be changed in response :with specifies a parameter for the HTTP request :frequency specifies how often to check :complete, :success, :failure associate with callbacks used depending on the outpcome of the reuqest

16-5 Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16.3 Example A special tag is used to introduce JavaScript into a Rails template A method update_city_state is defined as the :complete callback since two fields have to be changed with the response

16-6 Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16.3 The Controller The fill_city_state method is added to the controller to handle the asynchronous request The render method is used to create the content of the response since it is simple text