SlideShare a Scribd company logo
The Web: Concepts and Technology

                              Web Services (conclusion)
                                      Feb 19




1
    Eugene Agichtein   CS 190: The Web: Concepts and Technology, Emory University   Spring 2009
Today’s Plan
       Web Services
          JSON (review/summary)
          XML




2
    Eugene Agichtein   CS 190: The Web: Concepts and Technology, Emory University   Spring 2009
AJAX (Asynchronous Javascript + XML)
         (A    h       J      i t
       Uses browser’s XML support: DOM, XSLT
       XMLHttpRequest
       Google Maps is best-known AJAX application




3
    Agichtein for Emory CS171, Spring 2008
AJAX Design Principles
       The browser hosts an application, not content
         Application d delivered to b
         A li i code d li           d browser, mostly as J S i
                                                      l    JavaScript
         code
       The server delivers data, not content
         Data may be plain text, JavaScript fragments, or XML
         documents
       User/application interaction is continuous and fluid
          UI metaphors like drag-and-drop become possible
       This is real coding and requires discipline
         Significant developer responsibility to manage conversational
         state over entire web transaction


4
    Agichtein for Emory CS171, Spring 2008
Basic AJAX process




5
    Agichtein for Emory CS171, Spring 2008
JSON in Ajax
       HTML Delivery.

       JSON data is built into the page.
           <html>...
           <script>
           var data = { ... JSONdata ... };




6
    Agichtein for Emory CS171, Spring 2008
JSON in Ajax
       XMLHttpRequest
           Obtain responseText
           Parse the responseText

              responseData = eval(
                  '(' + responseText + ')');

              responseData =
                  responseText.parseJSON();




7
    Agichtein for Emory CS171, Spring 2008
JSON in Ajax
       Secret <iframe>
       Request data using form.submit to the
       <iframe> target.
       The server sends the JSON text embedded in a script in
       a document.
           <html><head><script>
            h l h d        i
           document.domain = 'penzance.com';
           parent.deliver({ ... JSONtext ... });
           </script></head></html>
       The function deliver is passed the value.
                               p
8
    Agichtein for Emory CS171, Spring 2008
JSON in Ajax
       Dynamic script tag hack.
       Create a script node. The src url makes the request.
       The server sends the JSON text embedded in a script.
           deliver({ ... JSONtext ... });
       The function deliver is passed the value.
       The dynamic script tag hack is insecure.
            y          p g




9
    Agichtein for Emory CS171, Spring 2008
JSONRequest
      A new facility.
      Two way data interchange between any page and any server.
      Exempt from the Same Origin Policy.
      Campaign to make a standard feature of all browsers.

     http://www.JSON.org/JSONRequest.html




10
      Agichtein for Emory CS171, Spring 2008
Yahoo Web Service with JSON
        Tutorial/Howto:
            http://developer.yahoo.com/common/json.html
            h      d l         h                   h l
        Can use nice interface widgets:
        http://developer.yahoo.com/yui/index.html
                           y           y
        http://developer.yahoo.com/yui/examples/datatable/dt_xhrjson.html




11
     Agichtein for Emory CS171, Spring 2008
jQuery Library
        http://jquery.com

       Usage: same as YUI
     <html>
       head
      <head>
       <script type="text/javascript" src="jquery.js"></script>
       <script type="text/javascript">
        // Your code goes here
                     g
       </script>
      </head>
           y
      <body>
       <a href="http://jquery.com/">jQuery</a>
      </body>
     </html>

12
     Eugene Agichtein   CS 190: The Web: Concepts and Technology, Emory University   Spring 2009
Google Maps API
     http://code.google.com/apis/maps/

http://cs190.mathcs.emory.edu/~cs190000/project1/maps.html




13
        Eugene Agichtein   CS 190: The Web: Concepts and Technology, Emory University   Spring 2009

More Related Content

PDF
API for Beginners
PPTX
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
PDF
GraphQL With Relay Part Deux
PPTX
Functional Reactive Endpoints using Spring 5
PDF
GraphQL Story: Intro To GraphQL
PDF
PPT
2310 b 03
PDF
GraphQL + relay
API for Beginners
Colin Bowern - The Not So Scary Side Of Asp.Net – Model View Controller In Th...
GraphQL With Relay Part Deux
Functional Reactive Endpoints using Spring 5
GraphQL Story: Intro To GraphQL
2310 b 03
GraphQL + relay

What's hot (19)

PDF
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
PDF
GraphQL in an Age of REST
PPTX
Rawnet Lightning Talk - Web Components
PDF
The spring ecosystem in 50 min
PDF
Performance optimisation with GraphQL
PPTX
Re-Learning JavaScript
PDF
GraphQL
PDF
Wrapping and Securing REST APIs with GraphQL
PDF
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
KEY
Using REST and XML Builder for legacy XML
PDF
[React Native Tutorial] Lecture 6: Component, Props, and Network
PPTX
Single-Page Lab - ASNApalooza 2014
PPTX
Creating asynchronous flows on AWS
PPT
ASP.NET 03 - Working With Web Server Controls
PDF
Modular GraphQL with Schema Stitching
PDF
Better APIs with GraphQL
PDF
Creating web api and consuming- part 1
PDF
From ActiveRecord to EventSourcing
PDF
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
GraphQL in an Age of REST
Rawnet Lightning Talk - Web Components
The spring ecosystem in 50 min
Performance optimisation with GraphQL
Re-Learning JavaScript
GraphQL
Wrapping and Securing REST APIs with GraphQL
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
Using REST and XML Builder for legacy XML
[React Native Tutorial] Lecture 6: Component, Props, and Network
Single-Page Lab - ASNApalooza 2014
Creating asynchronous flows on AWS
ASP.NET 03 - Working With Web Server Controls
Modular GraphQL with Schema Stitching
Better APIs with GraphQL
Creating web api and consuming- part 1
From ActiveRecord to EventSourcing
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
Ad

Viewers also liked (6)

PDF
PDF
pscs3vqp_excerpt
PDF
10 Mitow Pozycjonowania
PDF
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
PPT
Tanzani anestor
PDF
Panel de solutions javascript
pscs3vqp_excerpt
10 Mitow Pozycjonowania
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Tanzani anestor
Panel de solutions javascript
Ad

Similar to feb19-webservices3 (20)

PPT
CTS Conference Web 2.0 Tutorial Part 2
PPT
AJAX
PPTX
Walther Ajax4
PDF
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
ODP
Apache Aries Blog Sample
PDF
08 ajax
PPTX
PPTX
PPTX
Introduction about-ajax-framework
PPT
PDF
SAX - Android Development
PPT
Using Ajax In Domino Web Applications
PPT
Building Smart Workflows - Dan Diebolt
PPT
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
PPT
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnit
PPT
An Introduction to Ajax Programming
PPTX
Presentation Tier optimizations
PPTX
Ajax and Jquery
PPTX
Electron - cross platform desktop applications made easy
CTS Conference Web 2.0 Tutorial Part 2
AJAX
Walther Ajax4
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
Apache Aries Blog Sample
08 ajax
Introduction about-ajax-framework
SAX - Android Development
Using Ajax In Domino Web Applications
Building Smart Workflows - Dan Diebolt
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnit
An Introduction to Ajax Programming
Presentation Tier optimizations
Ajax and Jquery
Electron - cross platform desktop applications made easy

More from tutorialsruby (20)

PDF
&lt;img src="../i/r_14.png" />
PDF
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
PDF
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
PDF
&lt;img src="../i/r_14.png" />
PDF
&lt;img src="../i/r_14.png" />
PDF
Standardization and Knowledge Transfer – INS0
PDF
xhtml_basics
PDF
xhtml_basics
PDF
xhtml-documentation
PDF
xhtml-documentation
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
HowTo_CSS
PDF
HowTo_CSS
PDF
BloggingWithStyle_2008
PDF
BloggingWithStyle_2008
PDF
cascadingstylesheets
PDF
cascadingstylesheets
&lt;img src="../i/r_14.png" />
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
Standardization and Knowledge Transfer – INS0
xhtml_basics
xhtml_basics
xhtml-documentation
xhtml-documentation
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
HowTo_CSS
HowTo_CSS
BloggingWithStyle_2008
BloggingWithStyle_2008
cascadingstylesheets
cascadingstylesheets

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KodekX | Application Modernization Development
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
NewMind AI Monthly Chronicles - July 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

feb19-webservices3

  • 1. The Web: Concepts and Technology Web Services (conclusion) Feb 19 1 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009
  • 2. Today’s Plan Web Services JSON (review/summary) XML 2 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009
  • 3. AJAX (Asynchronous Javascript + XML) (A h J i t Uses browser’s XML support: DOM, XSLT XMLHttpRequest Google Maps is best-known AJAX application 3 Agichtein for Emory CS171, Spring 2008
  • 4. AJAX Design Principles The browser hosts an application, not content Application d delivered to b A li i code d li d browser, mostly as J S i l JavaScript code The server delivers data, not content Data may be plain text, JavaScript fragments, or XML documents User/application interaction is continuous and fluid UI metaphors like drag-and-drop become possible This is real coding and requires discipline Significant developer responsibility to manage conversational state over entire web transaction 4 Agichtein for Emory CS171, Spring 2008
  • 5. Basic AJAX process 5 Agichtein for Emory CS171, Spring 2008
  • 6. JSON in Ajax HTML Delivery. JSON data is built into the page. <html>... <script> var data = { ... JSONdata ... }; 6 Agichtein for Emory CS171, Spring 2008
  • 7. JSON in Ajax XMLHttpRequest Obtain responseText Parse the responseText responseData = eval( '(' + responseText + ')'); responseData = responseText.parseJSON(); 7 Agichtein for Emory CS171, Spring 2008
  • 8. JSON in Ajax Secret <iframe> Request data using form.submit to the <iframe> target. The server sends the JSON text embedded in a script in a document. <html><head><script> h l h d i document.domain = 'penzance.com'; parent.deliver({ ... JSONtext ... }); </script></head></html> The function deliver is passed the value. p 8 Agichtein for Emory CS171, Spring 2008
  • 9. JSON in Ajax Dynamic script tag hack. Create a script node. The src url makes the request. The server sends the JSON text embedded in a script. deliver({ ... JSONtext ... }); The function deliver is passed the value. The dynamic script tag hack is insecure. y p g 9 Agichtein for Emory CS171, Spring 2008
  • 10. JSONRequest A new facility. Two way data interchange between any page and any server. Exempt from the Same Origin Policy. Campaign to make a standard feature of all browsers. http://www.JSON.org/JSONRequest.html 10 Agichtein for Emory CS171, Spring 2008
  • 11. Yahoo Web Service with JSON Tutorial/Howto: http://developer.yahoo.com/common/json.html h d l h h l Can use nice interface widgets: http://developer.yahoo.com/yui/index.html y y http://developer.yahoo.com/yui/examples/datatable/dt_xhrjson.html 11 Agichtein for Emory CS171, Spring 2008
  • 12. jQuery Library http://jquery.com Usage: same as YUI <html> head <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> // Your code goes here g </script> </head> y <body> <a href="http://jquery.com/">jQuery</a> </body> </html> 12 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009
  • 13. Google Maps API http://code.google.com/apis/maps/ http://cs190.mathcs.emory.edu/~cs190000/project1/maps.html 13 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009