---
title: "handleJavaScriptAlert(message:initiatedBy:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webpage/dialogpresenting/handlejavascriptalert(message:initiatedby:)"
---

# handleJavaScriptAlert(message:initiatedBy:)

A JavaScript alert() function has been invoked.

## Declaration

```swift
@MainActor func handleJavaScriptAlert(message: String, initiatedBy frame: WebPage.FrameInfo) async
```

## Parameters

- `message`: The message provided by JavaScript.
- `frame`: Information about the frame whose JavaScript process initiated this call.
