Micro-letter Js-sdk Interface Operation interface Usage example _javascript tips

Source: Internet
Author: User

In this paper, we describe the interface usage of micro-JS-SDK interface. Share to everyone for your reference, specific as follows:

Prerequisite already obtains the permission to the interface in Wx.config (), takes the official document as the standard

Description

1. The interface and the use of interfaces currently provided are relatively simple

2. Some seem to be a little repetitive.

3. "Adjust the font", "complaints" These two tests can not be hidden, belong to the basic class

First, close the micro-mail browser window

Wx.closewindow ()

Window.close () off the micro-mail browser is not valid, the current method is blocked, and is not available in Cordova WebView

Show or hide part of the button interface

Description, the underlying class cannot control hidden and displayed

Hides the specified menu item, the menu item to hide/
/can only hide the propagate class and Protection class button
Wx.hidemenuitems ({
  menulist:[
  ' menuitem:exposearticle ',/ /Basic Class Menu cannot hide
  ' Menuitem:setfont '
  ]
};
' menuItem:share:weiboApp ',//share to Weibo, not available (belongs to propagate Class)
//' Menuitem:refresh '//  refresh button not available (belongs to base class)
//Show specified menu item
//can only display part of the propagate class and protection class
Wx.showmenuitems ({
  menulist:[
  ' menuItem:share:qq ',
  ' MenuItem: Copyurl ',
  ]
});

Show or hide non-basic button interfaces

Hide non-base button
Wx.hideallnonbasemenuitem ();
Show non-base button
Wx.showallnonbasemenuitem ();

four, show or hide menu , test Invalid, test results and non-basic button function the same

Hide upper right corner menu
wx.hideoptionmenu ();
Hide upper right corner menu
wx.showoptionmenu ();

Appendix 3-All menu items list

Basic class

Report: "Menuitem:exposearticle"
Adjust font: "Menuitem:setfont"
Daytime mode: "Menuitem:daymode"
Night mode: "Menuitem:nightmode"
Refresh: "Menuitem:refresh"
View public number (added): "Menuitem:profile"
View public number (not added): "Menuitem:addcontact"

Propagation class

Send to Friend: "MenuItem:share:appMessage"
Share to the circle of Friends: "MenuItem:share:timeline"
Share to QQ: "MENUITEM:SHARE:QQ"
Share to Weibo: "MenuItem:share:weiboApp"
Collection: "Menuitem:favorite"
Share to FB: "MenuItem:share:facebook"
Share to QQ space/menuitem:share:qzone

Protection class

Edit tag: "Menuitem:edittag"
Delete: "Menuitem:delete"
Copy link: "Menuitem:copyurl"
Original page: "Menuitem:originpage"
Reading mode: "Menuitem:readmode"
Open in QQ browser: "Menuitem:openwithqqbrowser"
Open in Safari: "Menuitem:openwithsafari"
Mail: "MenuItem:share:email"
Some special public numbers: "MenuItem:share:brand"

More readers interested in JavaScript-related content can view this site: "JavaScript in the JSON Operation tips Summary", "JavaScript switching effects and techniques summary", "JavaScript Search Algorithm Skills summary", " JavaScript animation effects and tips Summary, "JavaScript Error and debugging skills Summary", "JavaScript data structure and algorithm skills summary", "JavaScript traversal algorithm and Skills summary" and "JavaScript Mathematical operation Usage Summary"

I hope this article will help you with JavaScript programming.

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.