# Example Calls Using the Ajax Toolkit

The next two sections contain examples of synchrononous and asynchronous calls.

The AJAX Toolkit provides a debugging window that pops up when certain errors are encountered.

You can invoke logging explicitly using the `log()` method. For example, if you wanted to display the debugging window with the value of a variable at a certain point in your client application, you could add this line at the appropriate place:

```javascript
sforce.debug.log(myVar);
```

The AJAX Toolkit samples in the following sections use `log()`. To use the samples in the following sections, add this simple version of the `log` code before the first use of `log`:

```javascript
function log(message) {
  alert(message);
}

```

You can make `log()` as sophisticated as you wish.

- **[Examples of Synchronous Calls](/docs/platform/ajax/guide/sforce-api-ajax-more-samples.md)**

- **[Examples of Asynchronous Calls](/docs/platform/ajax/guide/sforce-api-ajax-more-samples-asynch.md)**
