# Last page message

When your pages are finite, it is best practise to inform the user that the last page was hit.

First add an element to your document with the message you want to show.

```html
<div class="no-more">No more pages</div>
```

Next add a bit of CSS to hide the element on default:

```css
.no-more {
  opacity: 0;
}
```

Then listen for the [`last`](/reference/events.md#last) event and show to element.

```javascript
let ias = new InfiniteAjaxScroll(/* config */);

ias.on('last', function() {
  let el = document.querySelector('.no-more');

  el.style.opacity = '1';
})
```

[View this behaviour in a live demo](https://infiniteajaxscroll.com/examples/articles/)


---

# 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://docs.infiniteajaxscroll.com/advanced/last-page-message.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.
