---
title: "Feature: #91122 - Introduce DocumentService as JQuery.ready substitute"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-91122"
source: "Changelog/10.4/Feature-91122-IntroduceDocumentServiceAsJQueryreadySubstitute.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Feature: #91122 - Introduce DocumentService as JQuery.ready substitute

See [forge#91122](https://forge.typo3.org/issues/91122)

## Description

The module `TYPO3/CMS/Core/DocumentService` provides native JavaScript
functions to detect DOM ready-state returning a `Promise<Document>`.

Internally the Promise is resolved when native `DOMContentLoaded` event has
been emitted or when `document.readyState` is defined already. It means
that initial HTML document has been completely loaded and parsed, without
waiting for stylesheets, images, and subframes to finish loading.

## Impact

```javascript
$(document).ready(() => {
  // your application code
});
```

Above JQuery code can be transformed into the following using `DocumentService`:

```javascript
require(['TYPO3/CMS/Core/DocumentService'], function (DocumentService) {
  DocumentService.ready().then(() => {
    // your application code
  });
});
```
