# Events

The component exposes two events: success and error. Pretty straightforward; the first one is triggered when an image is safely loaded and rendered, and the latter will be triggered when the browser fails to load the image. To deal with errors, make sure to check the [fallback image](/vue-progressive-image/fallback-image.md) chapter.

```html
<script setup>
const onSuccess = () => {
  // done!
}

const onError = () => {
  // ops!
}
</script>

<template>
  <ProgressiveImage
    @success="onSuccess"
    @error="onError"
    src="https://picsum.photos/id/1080/1980/1080"
  />
</template>gtnk
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://matteo-gabriele.gitbook.io/vue-progressive-image/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
