Competence Development Introduction to AJAX. What is AJAX? AJAX = Asynchronous JavaScript and XML For creating interactive web applications – Exchanging.

Slides:



Advertisements
Similar presentations
Fawaz Ghali AJAX: Web Programming's Toy.
Advertisements

Lecture 11 Server Side Interaction
JavaScript and AJAX Jonathan Foss University of Warwick
JQUERY/AJAX ALIREZA KHATAMIAN DELARAM YAZDANSEPAS.
Davis Dai. Introduction  Acronym for “asynchronous JavaScript and XML”  Combination of various technologies  Was not developed as an official standard.
Server-Side vs. Client-Side Scripting Languages
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Web Page Behavior IS 373—Web Standards Todd Will.
AJAX (Asynchronous JavaScript and XML) Amit Jain CS 590 – Winter 2008.
Does Ajax suck? CS575 Spring 2007 Chanwit Suebsureekul.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
-Uday Dhokale.  What is it ??? Prototype is a JavaScript Framework that aims to ease development of dynamic web applications.  Features a unique, easy-to-use.
1 JavaScript & AJAX CS , Spring JavaScript.
Introduction to AJAX AJAX Keywords: JavaScript and XML
JavaScript & jQuery the missing manual Chapter 11
CS 4720 RESTfulness and AJAX CS 4720 – Web & Mobile Systems.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
 2008 Pearson Education, Inc. All rights reserved Ajax-Enabled Rich Internet Applications.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Introduction to Applets CS 3505 Client Side Scripting with applets.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Web Applications BIS4430 – unit 8. Learning Objectives Explain the uses of web application frameworks Relate the client-side, server-side architecture.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Introduction to Client-Side Web Development Introduction to Client-Side programming using JavaScript JavaScript; application examples 10 th February 2005.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
XML & AJAX Khaled Al-Sham’aa. XML The Extensible Markup Language (XML) is a general-purpose specification for creating custom markup languages. It is.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
the acronym for Asynchronous JavaScript and XML.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
JQuery and AJAX WEB Technologies : PHP Programming Language.
 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.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
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.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
What is AJAX ? Asynchronous Javascript and XML. Not a stand-alone language or technology. It is a technique that combines a set of known technologies in.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
Ajax SUBMITTED BY NITIN RAMANI C.S.E 3 rd Y 5 th S R.N CS SUBMITTED TO PRO. PUSHPARAJ PATEL SIR.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
National College of Science & Information Technology.
What is AJAX ? Asynchronous Javascript and XML.
JavaScript and Ajax (Ajax Tutorial)
CS 371 Web Application Programming
AJAX and REST.
AJAX – Asynchronous JavaScript and XML
Application with Cross-Platform GUI
AJAX.
AJAX.
ISC440: Web Programming 2 AJAX
Secure Web Programming
AJAX CS-422 Dick Steflik.
Introduction to JavaScript
Creating dynamic/interactive web pages
Web Application Development Using PHP
Presentation transcript:

Competence Development Introduction to AJAX

What is AJAX? AJAX = Asynchronous JavaScript and XML For creating interactive web applications – Exchanging small amounts of data with the server ”behind the scenes” – Entire web pages do not have to be reloaded each time data is needed from the server Increases web pages interactivity, speed, functionality and usability Cross-platform technique usable on many different operating systems, computer architectures and web browsers Based on open standards such as JavaScript and DOM DOM (Document Object Model): a model in which the document or Web page contains objects (elements, links, etc.) that can be manipulated

What is AJAX? Asynchronous – extra data is requested from the server and loaded in the background without interfering the display and behavior of the existing page JavaScript is usually used for AJAX function calls Data is retrieved using the XMLHttpRequest object that is available to scripting languages run in modern browsers Alternatively, Remote Scripting can be used in browsers that do not support XMLHttpRequest. Asynchronous content does not need to be formatted in XML

Prototype – JavaScript Framework Unique, easy-to-use toolkit for class-driven development with one of the nicest Ajax libraries around Easy Ajax and DOM manipulation for dynamic web applications Quickly becoming the codebase of choice for web application developers everywhere

Example #1: Instructions Display contents of a text file in HTML DIV –element using AJAX when a button is pressed Basically this means that we will create a web page that calls a script in another file and then displays the result on our web page Of course we also need to create a DIV and a button No error checking is done, this is just a basic example

Example #1: First steps Download prototype.js and place it in your project directory Create text file to the same directory, e.g. testi.txt and add some data to it Create file (index.php) to the same directory, we use it as our web page Create file (skripti.php) to the same directory, we use it as our script file for reading data from another file

Example #1: Our web page Ajax example #1 JavaScript code is placed between HEAD-tags Create DIV and BUTTON between BODY-tags

Example #1: Our web page index.php Ajax example #1 function lue() { new Ajax.Request('skripti.php', { method: 'get', onSuccess: function(transport) { var tulos = $('tulos'); tulos.update(transport.responseText); } }); }

Example #1: Our script skripti.php <?php $tiedosto = file("testi.txt"); foreach($tiedosto as $rivi) print $rivi." "; ?> testi.txt example: KALLE KARI VILLE PEKKA TIMO JARI

Example #1: Results Test this example: Files: index.php skripti.php testi.txt prototype.js

Example #2: Instructions Save HTML form fields to text file and print loading and result message to HTML DIVs We create skripti.php like in previous example that saves submitted form data into a text file Our script will return an error message if file opening fails

Example #2: First steps Create index.php and skripti.php like in first example Make sure that directory has write rights (this can be changed with FTP client or by executing chmod +w manually for the directory)

Example #2: Our web page index.php Ajax example #2 function init() { $('submit').onclick = function () { sendData(); } function sendData() { var url = 'skripti.php'; var pars = Form.serialize('frm'); var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} ); } function showLoad() { $('load').style.display = 'block'; }

Example #2: Our web page cont. function showResponse(originalRequest) { var newData = originalRequest.responseText; $('load').style.display = 'none'; $('status').update(newData); } Etunimi: Sukunimi: Tallennetaan...

Example #2: Our script skripti.php <?php // luodaan tiedosto $tiedosto = fopen("tiedot.txt", "w"); if(!$tiedosto) print "Tiedoston aukaiseminen ei onnistunut!"; // kirjoitetaan vastaanotetut tiedot tiedostoon foreach($_GET as $tieto) fwrite($tiedosto, $tieto."\n"); print "Tiedot tallennettu onnistuneesti!"; ?>

Example #2: Results Test this example: Files: index.php skripti.php prototype.js

References

To be continued...