# JSSDK

# 1. web-view Component

A container component that hosts web page content.

Property Description

Property Type Default Value Required Description Minimum Version
src string No The web page link to open
timeout number 0 Specifies the timeout event. If the web page does not call ft.complete() within the specified time, the bindtimeout event will be triggered
bindmessage eventhandler No When the web page postMessages to the Mini-Program, it will be triggered at specific moments (Mini-Program back navigation, component destruction, share) and receive the message. e.detail = { data }, where data is an array composed of the parameters from multiple postMessage calls
bindload eventhandler No Triggered when the web page loads successfully. e.detail = { src }
binderror eventhandler No Triggered when the web page fails to load. e.detail = { src }
bindevent eventhandler No Receives data sent by the web page via JSSDK
bindtimeout eventhandler No Only takes effect when timeout is configured. Triggered when the web page load times out or the web page does not call ft.complete

# 2. JSSDK Introduction

JSSDK can be used in web-view web pages. By using JSSDK, web developers can efficiently use mobile system capabilities such as taking photos, selecting images, voice, and location, while also directly using the unique capabilities of Mini-Programs to provide users with a better web experience.

Since JSSDK is based on the capabilities provided by the web-view component in Mini-Programs, JSSDK can only be called when opening a domain link using web-view within a Mini-Program. Links opened by web-view are subject to whitelist control. Please configure the whitelist domain addresses in the Management Console under "Development Management - Domain Settings".

# 3. How to Use JSSDK in web-view

# 3.1 Import via script tag in the web page

<script src="path/to/jssdk.min.js">

JSSDK 1.4.21 (opens new window)

JSSDK 1.4.21(ESM) (opens new window)

# 3.2 Import via npm

  1. Install
npm install finclip-js-sdk
  1. Use
import ft from 'finclip-js-sdk'

ft.miniProgram.navigateTo({
  url: '/pages/index/index'
})
© FinClip with ❤ , Since 2017