1 / 15

RPG and Ajax why you should care?

RPG and Ajax why you should care?. Presented by: Robert Arce. It’s a way to create Interactive Web Applications A synchronous Ja vaScript and X ML It’s a small but very popular part of JavaScript. What is AJAX?. XHTML CSS (Cascading Style Sheets)

adie
Download Presentation

RPG and Ajax why you should care?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RPG and Ajax why you should care? Presented by: Robert Arce RPG and Ajax by Robert Arce from PrismaTech.

  2. It’s a way to create Interactive Web Applications Asynchronous JavaScript and XML It’s a small but very popular part of JavaScript What is AJAX? RPG and Ajax by Robert Arce from PrismaTech.

  3. XHTML CSS (Cascading Style Sheets) The DOM (Document Object Model) accessed using JavaScript XML, the format of the data being transferred between server and client XMLHttpRequest to retrieve data from the server AJAX is a combination of: RPG and Ajax by Robert Arce from PrismaTech.

  4. Most of the processing for the application is happening within the user’s browser, and requests to the server for data are usually short. Rich applications that depend on Web-based data, without the performance penalty of older approaches, which required that the server send back entire pages of HTLM in response to user actions The benefits of AJAX: RPG and Ajax by Robert Arce from PrismaTech.

  5. XHTML – contains the content and structure of the page CSS – controls the appearance and presentation of the page. Typography, colors, and size and placement of elements and images JavaScript – controls the behavior of the page manipulating the representation of the objects within the Document Object Model (DOM) Components RPG and Ajax by Robert Arce from PrismaTech.

  6. Control input from the user Change page on the fly based on the data coming from the iSeries Retrieve data from the iSeries as user is typing characters in a field Verify the data format in a form before submitting request to the server How can we use it? RPG and Ajax by Robert Arce from PrismaTech.

  7. A JavaScript Class that lets you make asynchronous HTTP requests from JavaScript Make an HTTP request from a JavaScript event A call back JavaScript function is invoked at each state of the HTTP request and response XMLHttpRequest RPG and Ajax by Robert Arce from PrismaTech.

  8. onreadystatechange - call back function for state changes readyState - the current state of the HTTP call responseText - the text result of the request responseXML - DOM xml object from the request status - HTTP status code of the response statusText - HTTP status text XMLHttpRequest Properties RPG and Ajax by Robert Arce from PrismaTech.

  9. HTML part <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Shakespeare's Plays</title> <link type="text/css" rel="stylesheet" ref="script01.css" /> <script type="text/javascript" src="script01.js"> </script> </head> <body> <h1>MMSA presentation</h1> <div id='ajaxDiv'>Result will display here</div>> </body> </html> RPG and Ajax by Robert Arce from PrismaTech.

  10. Javascript – AJAX – part 1-3 var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } RPG and Ajax by Robert Arce from PrismaTech.

  11. Javascript – AJAX – part 2-3 // Create function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay= document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } //0=Unitialized; Object contains no data //1=Loading; 2=Loaded; object is loading or loaded //3=Interactive; user may interact with object but not fully loaded //4=Complete; object has finished initializing RPG and Ajax by Robert Arce from PrismaTech.

  12. Javascript – AJAX – part 3-3 var itemnumber = document.getElementById('itemnumber').value; var queryString = "?itemnumber=" + itemnumber; //This is the actual call to the server //Open has three parms: HTTP request method “GET”, “POST” or “HEAD”, URL to a file on the server and a boolean telling the server if request is asynchronous o not. ajaxRequest.open("GET", "getItemImageSrv.php"+ queryString, true); ajaxRequest.send(null); RPG and Ajax by Robert Arce from PrismaTech.

  13. Firefox with Firebug Internet Explorer Developer Tools WDSc – yes same IDE for RPG Zend studio for eclipse i5 Tools RPG and Ajax by Robert Arce from PrismaTech.

  14. JavaScript & Ajax – Peachpit Press – Tom Negrino and Dori Smith Professional Ajax – 2nd Edition – WROX – Nicholas C. Zakas, jeremy McPeak, Joe Fawcett Web places… http://www.javascriptworld.com/ References RPG and Ajax by Robert Arce from PrismaTech.

  15. AJAX !!!Use this technique for Developing your Web Applications to talk to your RPG programs Thank you !!! RPG and Ajax by Robert Arce from PrismaTech.

More Related