O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

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

Changing the Global Setup

$.ajaxSetup({url:"service.php", accepts:"json})

jQuery provides the .ajaxSetup() method that allows you to specify options that configure AJAX requests throughout the script. Table 13.2 lists some of the options that can be specified when calling .ajaxSetup(). For example, the following code sets the default global URL for requests:

$.ajaxSetup({url:"service.php", accepts:"json})

Image

Table 13.2 jQuery Global AJAX Event Handler Registration Methods

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