<frame>

A page element similar to HTML's <iframe>, which can embed a Lynx page into the current page.

Usage Guide

The following is an example of a main page loading an embedded page via the <frame> element.

  • The main page passes initData and globalProps to the embedded page through the data and globalProps attributes.
  • The main page listens for the embedded page loading status via the bindload event.

Main Page

Embedded Page

TIP

The <frame> element was introduced in

3.4. To use this element, the Lynx dependency version must be upgraded to
3.4
or higher.

CAUTION

<frame> does not currently support automatic height adjustment. You need to manually set the width and height of the frame.

Attributes

data

Android
iOS
3.4
data?: Record<string, unknown>;

Passes data to the nested Lynx page within the frame.

global-props

Android
iOS
3.6
'global-props'?: Record<string, unknown>;

Passes globalProps to the Lynx page embedded in the frame. The embedded page can read it via lynx.__globalProps.

src

Android
iOS
3.4
src: string;

Sets the loading path for the frame resource.

Events

Frontend can bind corresponding event callbacks to listen for runtime behaviors of the element, as shown below.

bindload

Android
iOS
3.6
bindload = (e: FrameLoadEvent) => {};
FieldTypeOptionalDefaultPlatformsSinceDescription
statusCodenumberNo
Android
iOS
3.6
3.6Frame loaded status code.
statusMessagestringNo
Android
iOS
3.6
3.6Frame loaded status message.
urlstringNo
Android
iOS
3.6
3.6The loaded url of the frame.

Bind frame load event callback.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.