Are there Usability Issues with AJAX?

Thursday, April 1, 2010 11:51
Posted in category WWW - Internet

The nature of updating a page dynamically using data retrieved via AJAX interactions and DHTML may result in drastically changing the appearance and state of a page. A user might choose to use the browser’s back or forward buttons, bookmark a page, copy the URL from the URL bar and share it with a friend via an email or chat client, or print a page at any given time. When designing an AJAX based application you need to consider what the expected behavior would be in the case of navigation, bookmarking, printing, and browser support as described below.

  • Navigation – What would be the expected behavior of the back, forward, refresh, and bookmark browser buttons in your application design. While you could implement history manipulation manually it may be easer to use a JavaScript frameworks such as Dojo that provides API’s history manipulation and navigation control.
  • Bookmarking and URL sharing – Many users want to bookmark or cut and paste the URL from the browser bar. Dojo provides client-side for bookmarking and URL manipulation.

Printing – In some cases printing dynamically rendered pages can be problematic.
Other considerations as a developer when using AJAX are:

  • Browser Support – Not all AJAX/DHTML features are supported on all browsers or all versions of a browser. See quirksmode.org for a list of browser support and possible workarounds.
  • JavaScript disabled – You should also consider what happens if the user disables JavaScript. Additionally, there are several legitimate reasons why JavaScript and CSS support may be unavailable on a user’s web browser.
  • Latency – Keep in mind latency in your design. A running application will be much more responsive than when it is deployed.
    Latency problems: myth or reality?
  • Accessibility – Guaranteeing your site is accessible to people with disabilities is not only a noble goal, it is also requited by law in many markets. Some marvelous enabling technology is available to help people use the Web in spite of disabilities including visual, auditory, physical, speech, cognitive, and neurological disabilities. With a little forethought, and comprehension of some well documented best practices, you can assure that your application is compatible with that enabling technology.
  • Degradability is the term used to describe techniques used by web applications to adapt to the wide range of web browser capabilities. Many AJAX libraries have automatic degradability built in. But if you are coding your own custom AJAX functionality, simply taking some care to follow the best practices promoted by standards bodies like the World Wide Web Consortium (W3C), and grass root movements like the Web Standards community and many others, your application can run usefully on browsers that are incapable of AJAX behaviors. Granted, your application may loose some of the “wow factor” on these less capable browsers, but your application will still be usable.
    Remember to not design with AJAX just for the sake of coolness. The reason you built your application is so people will use it. And people will not use your application if your application is not compatible with their web browser.

    • Share/Bookmark

Does my Hosting Provider supports AJAX on SERVER-SIDE?

Wednesday, March 31, 2010 11:48
Posted in category Ajax - Reverse Xaja

You may be benefiting from AJAX already. Many existing Java based frameworks already have some level of AJAX interactions and new frameworks and component libraries are being developed to provide better AJAX support. I won’t list all the Java frameworks that use AJAX here, out of fear of missing someone, but you can find a good list at www.ajaxpatterns.org/Java_Ajax_Frameworks.

If you have not chosen a framework yet it is recommended you consider using Java Server Faces or a Java Server Faces based framework. Java Server Faces components can be created and used to abstract many of the details of generating JavaScript, AJAX interactions, and DHTML processing and thus enable simple AJAX used by JSF application developer and as plug-ins in JSF compatible IDE’s, such as Sun Java Studio Creator.

  • Share/Bookmark

Should I use an HTTP GET or POST for my AJAX calls?

Tuesday, March 30, 2010 11:46
Posted in category Ajax - Reverse Xaja

AJAX requests should use an HTTP GET request when retrieving data where the data will not change for a given request URL. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idempotency recommendations and is highly recommended for a consistent web application architecture.

  • Share/Bookmark

Security Issues about AJAX

Monday, March 29, 2010 11:42
Posted in category Ajax - Reverse Xaja

JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local file-system without the user’s permission. An AJAX interaction can only be made with the servers-side component from which the page was loaded. A proxy pattern could be used for AJAX interactions with external services.

You need to be careful not to expose your application model in such as way that your server-side components are at risk if a nefarious user to reverse engineer your application. As with any other web application, consider using HTTPS to secure the connection when confidential information is being exchanged.

  • Share/Bookmark

How do I abort the current XMLHttpRequest?

Sunday, March 28, 2010 11:43
Posted in category Ajax - Reverse Xaja

Just call the abort() method on the request.

  • Share/Bookmark

Is the XMLHttpRequest object part of a W3C standard?

Saturday, March 27, 2010 11:40
Posted in category Ajax - Reverse Xaja

No. Or not yet. It is part of the DOM Level 3 Load and Save Specification proposal.

  • Share/Bookmark

AJAX Debugging methods

Friday, March 26, 2010 11:38
Posted in category Ajax - Reverse Xaja

There are not that many tools out there that will support both client-side and server-side debugging. I am certain this will change as AJAX applications proliferate. I currently do my client-side and server-side debugging separately. Below is some information on the client-side debuggers on some of the commonly used browsers.

  • Firefox/Mozilla/Netscape – Have a built in debugger Venkman which can be helpful but there is a Firefox add on known as FireBug which provides all the information and AJAX developer would ever need including the ability to inspect the browser DOM, console access to the JavaScript runtime in the browser, and the ability to see the HTTP requests and responses (including those made by an XMLHttpRequest). I tend to develop my applications initially on Firefox using Firebug then venture out to the other browsers.
  • Safari – Has a debugger which needs to be enabled. See the Safari FAQ for details.
  • Internet Explorer – There is MSDN Documentation on debugging JavaScript. A developer toolbar for Internet Explorer may also be helpful.

While debuggers help a common technique knowing as “Alert Debugging” may be used. In this case you place “alert()” function calls inline much like you would a System.out.println. While a little primitive it works for most basic cases. Some frameworks such as Dojo provide APIs for tracking debug statements.

  • Share/Bookmark

How does Hardworking IT Professionals look like ?

Thursday, March 25, 2010 20:58
Posted in category WWW - Internet

  • Share/Bookmark

Can I use Ajax with Microsoft’s .NET?

Thursday, March 25, 2010 11:35

See http://ajax.schwarz-interactive.de/ for a free AJAX implementation for the .NET Framework.

  • Share/Bookmark

How can we define SESSION variable in JAVASCRIPT ?

Wednesday, March 24, 2010 11:33

It’s not possible to set any session variables directly from java-script as it is purely a client side technology. You can use AJAX though to asynchronously.

  • Share/Bookmark