tencent cloud

Feedback

Web-View

Last updated: 2024-07-12 16:51:08
    When mini program developers use the WebView component, they may need to call some mini program APIs from the HTML5 page. This is where the JS SDK comes into play.
    The JS SDK is a toolkit for web developers. By using the JS SDK, web developers can enable certain native capabilities (such as taking photos, selecting images, recording audio, getting location, etc.) on the HTML5 page within the mini program. This enhances the user experience on the web page.
    Since the JS SDK is used within the Webview container of a mini program, it only supports links opened within the mini program. For domain management of the web page, please refer to the domain whitelist configuration in the console.

    How to Use

    Load the corresponding JS SDK in your web page with the following code:
    <script src="path/to/jssdk.js"></script>
    
    <script>
    // go to pay Page from click in H5 Page
    document.getElementById("payBtn").click = funciton(e){
    wx.miniProgram.navigateTo({ url : "/pages/pay/pay"});
    }
    </script>

    Download link

    jssdk.js(19.5KB)
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support