O'Reilly logo

Jasmine Cookbook by Munish Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Jasmine specs for AJAX

Using AJAX, we can load data in the background and display it on the web page without reloading the whole page. Whenever an AJAX request is initiated, it creates an XMLHttpRequest object and sends an HttpRequest request to the server. The server processes the request and sends the response back to the browser. In other words, AJAX allows web applications to send/retrieve data to/from a server asynchronously without interfering with the display and behavior of the existing page. It is hard to test asynchronous processes. However, the Jasmine library provides a couple of tools for handling AJAX calls. In this recipe, you will learn how to write Jasmine specs for AJAX calls.

Getting ready

Now, to write Jasmine specs for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required