Thursday, 5 December 2013

What is Ajax? - Learn more with @s.shivasurya


Ajax scripts plays a vital role in web development and enhances the user experience in the website.they provide excellent environment for users to get update instantly with a better look without any action such as reloading or refreshing.Nowadays most of the web application uses ajax scripts numerously for the better action towards database and user interface.
auto suggestion list of google








example You may take facebook comments for ajax
,
Facebook comments are driven by Ajax scripts,when you guys just tap over the comment box ,the ajax scripts carry the data to the database through a php or any other programmed file and then result would be in the form of the new comments.but actually the append the comment near the old comment.only when You refresh the whole page,You are really querying a database to get the comment.thus Ajax plays vital role in compromising both programmer and the user.it is the script which allows the programmers to pass the data easily and display the data in excellent original format for the users.
almost Every function in facebook  works as ajax scripts rite from Friend request tll Your personal messages uses basic principle of ajax.

another famous example from Google for ajax,

from around 2004 Google is using the auto-suggest list from this Ajax became famous all around ,started implementing in websites which makes excellent user interface for users.you cant ever imagine how does this autosuggestion works.just a simple way,when You type the letters they are take by Ajax scripts through same internet connection and queries the database and returns the results in the form of drop-down box of your suggested list.this all happens in fraction of seconds.thats Why ajax-javascript is famous and reliable for users in graphical user interface.



What Would Happen if there is no Ajax Tech in websites:

1)You need to reload for every Like action,updating status,there would be total failure in the messaging system since you have to reload the page for every now and then for new messages.
2)users have to type a long forms and waiting for the server to provide them results as failure or sucess after a long reload.
3)You wont get instant results in google search engine.


Drawbacks

  • In pre-HTML5 browsers, pages dynamically created using successive Ajax requests did not automatically register themselves with the browser's history engine, so clicking the browser's "back" button may not have returned the browser to an earlier state of the Ajax-enabled page, but may have instead returned to the last full page visited before it. Such behavior—navigating between pages instead of navigating between page states—may be desirable, but if fine-grained tracking of page state is required then a pre-HTML5 workaround was to use invisible iframes to trigger changes in the browser's history. A workaround implemented by Ajax techniques is to change the URL fragment identifier (the part of a URL after the '#') when an Ajax-enabled page is accessed and monitor it for changes. HTML5 provides an extensive API standard for working with the browser's history engine.
  • Dynamic web page updates also make it difficult to bookmark and return to a particular state of the application. Solutions to this problem exist, many of which again use the URL fragment identifier. The solution provided by HTML5 for the above problem also applies for this.
  • Depending on the nature of the Ajax application, dynamic page updates may interfere disruptively with user interactions, especially if working on an unstable Internet connection. For instance, editing a search field may trigger a query to the server for search completions, but the user may not know that a search completion popup is forthcoming, and if the internet connection is slow, the popup list may show up at an inconvenient time, when the user has already proceeded to do something else.
  • Because most web crawlers do not execute JavaScript code,publicly indexable web applications should provide an alternative means of accessing the content that would normally be retrieved with Ajax, thereby allowing search engines to index it.
  • Any user whose browser does not support JavaScript or XMLHttpRequest, or simply has this functionality disabled, will not be able to properly use pages which depend on Ajax. Devices such as smartphones and PDAs may not have support for the required technologies, though this is becoming less of an issue. The only way to let the user carry out functionality is to fall back to non-JavaScript methods. This can be achieved by making sure links and forms can be resolved properly and not relying solely on Ajax.
  • Similarly, some web applications which use Ajax are built in a way that cannot be read by screen-reading technologies, such as JAWS. The WAI-ARIA standards provide a way to provide hints in such a case.
  • Screen readers that are able to use Ajax may still not be able to properly read the dynamically generated content.
  • The same origin policy prevents some Ajax techniques from being used across domains, although the W3C has a draft of the XMLHttpRequest object that would enable this functionality.Methods exist to sidestep this security feature by using a special Cross Domain Communications channel embedded as an iframe within a page, or by the use of JSONP.
  • The asynchronous callback-style of programming required can lead to complex code that is hard to maintain, to debug and to test.

    finally I would say "Ajax is like instant coffee! which makes life simpler and easier and look better"

0 comments:

Post a Comment