It is very safe to use Dojo like java script frameworks for Ajax operations since they ensure browser compatibility. We don't have to change the code based on different browsers. dojo will handle those stuff for us. Any way , If we are using such java script frameworks for Ajax operations we must carefully choose a proper framework with wide range of browser support.
In this example I have used a very simple Servlet and a simple HTML page to demonstrate the client server model.