WeChat public platform development (91) button in the upper right corner/navigation bar at the bottom/user network status

Source: Internet
Author: User

Hide buttons in the upper-right corner of a webpage

If you do not need to share a page, you can use JavaScript code to hide the buttons in the upper-right corner of the page.

Interface call code (JavaScript)

document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {WeixinJSBridge.call('hideOptionMenu');});

Return description

No return value is returned in the bottom navigation bar. (Replace hideOptionMenu with showOptionMenu for display)

 

Hide the navigation bar at the bottom of a web page

When the public account is needed (for example, if you think that the browser is not used to move forward or backward on the page), you can use JavaScript code to hide the navigation bar at the bottom of the page.

Interface call code (JavaScript)

document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {WeixinJSBridge.call('hideToolbar');});

Return description

No return value is returned in the bottom navigation bar. (To display the top navigation bar, replace hideToolbar with showToolbar)

 

Web page to get the user's network status

To help developers provide different quality services based on their network status, the public account can be called using JavaScript code on the webpage of the public account to obtain the network status.

Interface call code (JavaScript)

WeixinJSBridge.invoke('getNetworkType',{},function(e){    WeixinJSBridge.log(e.err_msg);    });

Return description

The returned values for retrieving the user's network status are as follows:

Network_type: wifi network network_type: edge non-wifi, including 3G/2Gnetwork_type: fail network disconnected network_type: wwan (2g or 3G)

The test code comes from public platform development best practices.
Fanwe Studio

Effect display:

========================================================== ======================================

Follow-up methods for fanwe public platform accounts:
1. Address Book-Add friends-search for Public Accounts-search for "fangtimes Studio"
2. Address Book-add friend-search number-Enter "pondbaystudio"
3. Scan the following QR code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.