---
title: "loadAlternateHTMLString(_:baseURL:forUnreachableURL:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webframe/loadalternatehtmlstring(_:baseurl:forunreachableurl:)"
---

# loadAlternateHTMLString(_:baseURL:forUnreachableURL:)

Loads alternate content for a frame whose URL is unreachable.

## Declaration

```swift
func loadAlternateHTMLString(_ string: String!, baseURL: URL!, forUnreachableURL unreachableURL: URL!)
```

## Parameters

- `string`: The string to use as the main page for the document.
- `baseURL`: A file that is used to resolve relative URLs within the document.
- `unreachableURL`: The URL for the alternate page content.

## Discussion

Discussion Use this method to display page-level loading errors in a web view. Typically, a WebFrameLoadDelegate or WebPolicyDelegate object invokes this method from these methods: webView:didFailProvisionalLoadWithError:forFrame: (WebFrameLoadDelegate), webView:decidePolicyForMIMEType:request:frame:decisionListener: (WebPolicyDelegate), or webView(_:unableToImplementPolicyWithError:frame:) (WebPolicyDelegate). If invoked from one of these methods, the back-forward list is maintained.

## See Also

### Loading Content

- [load(_:)](webkit/webframe/load(_:)-47p2s.md)
- [reload()](webkit/webframe/reload().md)
- [reloadFromOrigin()](webkit/webframe/reloadfromorigin().md)
- [stopLoading()](webkit/webframe/stoploading().md)
- [loadHTMLString(_:baseURL:)](webkit/webframe/loadhtmlstring(_:baseurl:).md)
- [load(_:mimeType:textEncodingName:baseURL:)](webkit/webframe/load(_:mimetype:textencodingname:baseurl:).md)
- [load(_:)](webkit/webframe/load(_:)-6wkx6.md)
