Web-Applications & AJAX

Slides:



Advertisements
Similar presentations
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Advertisements

Copyright © Steven W. Johnson
Languages for Dynamic Web Documents
Multiple Tiers in Action
HTML 1 Introduction to HTML. 2 Objectives Describe the Internet and its associated key terms Describe the World Wide Web and its associated key terms.
Fundamentals, DOM, Events, AJAX, UI Doncho Minkov Telerik Corporation
JQuery CS 268. What is jQuery? From their web site:
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
JavaScript & jQuery the missing manual Chapter 11
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Server-side Scripting Powering the webs favourite services.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Interacting with a Web Page using JavaScript Mat Kelly GTAI Presentation January 10, 2014.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
INNOV-7: Building a Richer UI for the Browser Chris Skeldon Senior Solution Consultant.
CSS1 Dynamic HTML Objects, Collections & Events. CSS2 Introduction Dynamic HTML treats HTML elements as objects. Element’s parameters can be treated as.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Event Handling & AJAX IT210 Web Systems. Question How do we enable users to dynamically interact with a website? Answer: Use mouse and keyboard to trigger.
USING JAVASCRIPT TO SHOW AN ALERT Web Design Sec 6-2 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
JS DOM. Introduction An HTML page is rendered (painted) in a browser The browser assembles all the elements (objects) contained in the HTML page To create.
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.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Chapter 1 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.
Intro Web Applications Andrew Benson – ScottyLabs – CrashCourse F14.
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
SE-2840 Dr. Mark L. Hornick 1 Dynamic HTML Handling events from DOM objects.
Servlets What is a Servlet?
Web Systems & Technologies
Web Technologies Computing Science Thompson Rivers University
JavaScript and Ajax (Ajax Tutorial)
Week 4: Introduction to Javascript
AJAX and REST.
AJAX.
PHP / MySQL Introduction
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
JavaScript Introduction
DHTML Javascript Internet Technology.
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Web Programming A different world! Three main languages/tools No Java
Web Browser server client 3-Tier Architecture Apache web server PHP
DHTML Javascript Internet Technology.
JavaScript & jQuery AJAX.
MIS JavaScript and API Workshop (Part 3)
Training & Development
DR. JOHN ABRAHAM PROFESSOR UTPA
Web Technologies Computing Science Thompson Rivers University
JavaScript and Ajax (JavaScript Events)
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Project BCHB697.
Client-Server Model: Requesting a Web Page
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Introduction to Web programming
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Web-Applications & AJAX BCHB697

Outline Web-Applications AJAX enables browser-based applications Traditional server-based model Browser-based application model AJAX enables browser-based applications Static, empty HTML page as application shell Javascript requests data from web-service Javascript constructs HTML on the fly Parameters from URL or from events BCHB697 - Edwards

Traditional Web-Application Each click (link / anchor / button / input field) generates a HTTP request Web-server runs Perl/Python/PHP to: Connect to database Query data Generate HTML page from data Send HTML etc. back to browser BCHB697 - Edwards

Browser-based Web-app Each click generates Javascript events in the browser Javascript executes code to: Request new data Wait for data to arrive Redraw page Server provides web-service only (no presentation) BCHB697 - Edwards

AJAX Asynchronous Javascript and XML Enables browser-based Web-app JSON used more widely than XML now Enables browser-based Web-app Presentation resides in the browser Seamless, asynchronous, event driven UI/UX Web-service just provides the data c.f. document store Streamline support for: Cell-phone apps, web-browser, automated systems BCHB697 - Edwards

Single Page Web-Application Single HTML page links: CSS style sheet Javascript code to respond to events, and render page in HTML Body of HTML page: Basic page layout DIV containers for dynamic HTML rendering URL-based history mechanism is lost! Application state no longer in the browser. BCHB697 - Edwards

Event Driven Applications Events associated with HTML elements can be handled by a javascript function Event: onload: Fires when the page is finished loading (incl. supporting Javascript and CSS documents) Event: onclick: Fires when the HTML element is clicked AJAX data requests take time, provide function to run when data is available. BCHB697 - Edwards

Event Driven Applications <html> <script> function render() { json_ws_get(wsurl,function(data) { var tablestr = construct_table(data); var container = document.getElementById('container') container.innerHTML = tablestr; } </script> <body onload="render()"> <div id="container"/> <br/> <A href="#" onclick="render()">Refresh</A> </body> </html> BCHB697 - Edwards

Useful Javascript Snippets alert("message") console.log("message"), console.log(obj) Objects are the same as dictionaries: data["accession"] == data.accession Use Web-Developer tools to figure out where your Javascript is broken. BCHB697 - Edwards

Example: Protein Browser BCHB697 - Edwards

Example: Protein Browser BCHB697 - Edwards

Example: Protein Browser BCHB697 - Edwards

Example: Protein Browser BCHB697 - Edwards

Example: Protein Browser BCHB697 - Edwards

Example: Protein Browser BCHB697 - Edwards

Example: Protein Browser proteins.html Single HTML file, loads css and javascript onload event on body element proteins.js Functions to render proteins table and protein detail pages Uses anchors with onclick event for request new rendering style.css, util.js BCHB697 - Edwards

Example: Protein Browser proteins.html BCHB697 - Edwards

Example: Protein Browser proteins.js BCHB697 - Edwards

Example: Protein Browser proteins.js BCHB697 - Edwards

Exericse Add a search input field to the protein table Use the onchange event to filter the table Combine ideas from Lecture 11 & 12 BCHB697 - Edwards