Your SlideShare is downloading. ×
mukesh
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

mukesh

985
views

Published on

ajax mukesh rbs college

ajax mukesh rbs college

Published in: Technology, News & Politics

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
985
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • AJAX – has taken IT industry by storm. It might turn out to be one of the most demanded thing/in thing and hence, a brief presentation to understand AJAX. Be it anything that we are learning, asking 6 key questions is very important to get an overall idea of the same. The questions being – What, Why, Who, How, When and Where. So let’s being with what is AJAX? – not a technology, not a product … but an approach taken to develop Web Applications.
  • Inorder to understand what is this approach all about … let us first seek to know what the current approach is … At present, for every user interaction, the entire web page is rebuild. Even if a part of the entire page needs to be changed … we land up reloading the entire page. Which leads to … network traffic … slow speed … and most importantly … user experience goes down … user has to wait for loading of images … controls … which had already been loaded once!!! This is what AJAX asks us not to do.
  • Continuous Feel: Traditional web applications force you to submit a form, wait a few seconds, watch the page redraw, and then add some more info. Forgot to enter the area code in a phone number? Start all over again. Sometimes, you feel like you're in the middle of a traffic jam: go 20 metres, stop a minute, go 20 metres, stop a minute ... How many E-Commerce sales have been lost because the user encountered one too many error message and gave up the battle? Ajax offers a smooth ride all the way. There's no page reloads here - you're just doing stuff and the browser is responding. Real-Time Updates: As part of the continous feel, Ajax applications can update the page in real-time. Currently, news services on the web redraw the entire page at intervals, e.g. once every 15 minutes. In contrast, it's feasible for a browser running an Ajax applciation to poll the server every few seconds, so it's capable of updating any information directly on the parts of the page that need changing. The rest of the page is unaffected. Graphical Interaction: Flashy backdrops are abundant on the web, but the basic mode of interaction has nevertheless mimicked the 1970s-style form-based data entry systems. Ajax represents a transition into the world of GUI controls visible on present-day desktops. Thus, you will encounter animations such as fading text to tell you something's just been saved, you will be able to drag items around, you will see some static text suddenly turn into an edit field as you hover over it.
  • Transcript

    • 1. AJAX – Asynchronous JavaScript and XML Vijay Khambalkar Magnet Technologies Pvt. Ltd.
    • 2. What is AJAX ? Ajax is just a style of design, one that makes feel less web and more desktop
    • 3. Why AJAX ?
      • Reduce Network Traffic
      • Increase Speed
      • Enhance User Experience
    • 4. AJAX Characteristics :
      • Continuous Feel
      • Real Time Updates
      • Graphical Interactions
    • 5. Ajax Lifecycle
    • 6. How to use AJAX practically ?
      • Use iFrame
      • Go the “XmlHttpRequest” way !
    • 7. XmlHttpRequest ?
      • Client Side Component.
      • Must be instantiated before use.
      • Use open() method to connect and retrieve response from the specified URL.
      • Handle onreadystatechange Event.
    • 8. XmlHttpRequest Component
      • Internet Explorer 5
      • Mozilla 1.0 – Netscape 7
      • Safari 1.2
      • Opera 7.6
      • Firefox
    • 9. Let’s see some coding : var req; function retrieveURL(url) {     if (window.XMLHttpRequest) // Non-IE browsers {       req = new XMLHttpRequest();     } else if (window.ActiveXObject) // IE {       req = new ActiveXObject("Microsoft.XMLHTTP");     }      req.open("GET", url, true);      req.onreadystatechange = processStateChange;      req.send(null);   }
    • 10. Let’s see some coding : function processStateChange() {     if (req.readyState == 4) // Complete {       if (req.status == 200) // OK response {         document.getElementById(“MyContent").innerHTML = req.responseText;       }     }   }  
    • 11. Who created AJAX ?
      • No one created AJAX !
      • AJAX = A synchronous J avaScript A nd X ML
      • Jesse James Garett coined term AJAX in his article - “AJAX : A new approach for a new application”
    • 12. AJAX with PHP
    • 13. Coding : PHP [server.php]
      • <?php
      • //Display Message
        • echo “This is Ajax with PHP “;
      • ?>
    • 14. Coding: Javascript [client.htm]
      • <html>
      • <script language=“javascript”>
      • function createRequestObject()
      • {
        • var httpObj;
        • var browser=navigator.appName;
        • if(browser==&quot;Microsoft Internet Explorer&quot;){
        • httpObj = ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
        • }else{
        • httpObj = new XMLHttpRequest();
        • }
        • return http;
      • }
      • var http = createRequestObject(); - Continued
    • 15. Coding: Javascript [client.htm]
      • var requestObject=createRequestObject();
      • function sendRequest(page)
      • {
      • requestObject.open('get',page);
      • requestObject.onreadystatechange=displayContent;
      • requestObject.send(null);
      • }
      • - Continued
    • 16. Coding: Javascript [client.htm]
      • function displayContent()
      • {
      • if(requestObject.readyState==4){
      • var data=requestObject.responseText;
      • document.getElementById('contact').innerHTML=data+&quot;<br>&quot;;
      • }
      • }
      • </script>
      • <body>
      • <a href=&quot;javascript:sendRequest('server.php')&quot;>Click here to View the page</a><br>
      • <div id=“contact&quot;> </div>
      • </body></html>
    • 17. AJAX Libraries in PHP
      • SAJAX
      • XAJAX
      • AJAXAC
      • JPSPAN
    • 18. Lets Try Out Example
    • 19. When to go the AJAX way ? “ Not Always !!! Abuse of any technology would make it a liability !!! ”
    • 20. Where has AJAX been used ?
      • Google Maps http://maps.google.com
      • Google Suggest http://www.google.com/webhp?complete=1&hl=en
      • GMail
      • Flickr
      • A9.com
    • 21. Limitations of AJAX
      • JavaScript Implementations.
      • Debugging.
      • Security.
    • 22. Summary
    • 23. Thank You

    ×