Ways to add a link to a micro-credit public account in a website

Source: Internet
Author: User

Here the so-called micro-letter public account of the random spread, refers to your micro-letter public number to spread to micro-trust friends, micro-trust friend Circle, after the friend point in the shortest possible way to pay attention to the success of your micro-letter public number! If your article was pushed through a micro-trust public platform, go in, You will find that the public number nickname is clickable and can directly open the public data page. We might as well take a look at its source code:

HTML code:

Baidufe

JavaScript code:

function Viewprofile () {

if (typeof Weixinjsbridge!= "undefined" && weixinjsbridge.invoke) {

Weixinjsbridge.invoke (' profile ', {

' username ': ' gh_dd4b2c2ada8b ',/* Your public number original ID * *

' Scene ': ' 57 '

});

}

}

You might be happy to think that this code works!

In fact, this code is in effect, there are restrictive conditions: The IOS environment, only in the Mp.weixin.qq.com domain entry into force!

Of course, you can suspect that we can then make a simple change to the JavaScript code above to see what information is available in the callback:

function Viewprofile () {

if (typeof Weixinjsbridge!= "undefined" && weixinjsbridge.invoke) {

Weixinjsbridge.invoke (' profile ', {

' username ': ' gh_dd4b2c2ada8b ',/* Your public number original ID * *

' Scene ': ' 57 '

},function (RESP) {

alert (resp.err_msg); /* Here, we put the err_msg output * *

});

}

}

We deploy the code to our own Web server, such as: http://www.baidufe.com/demo/wxid_test.html, then open the link in a micro-mail built-in browser, and click a tag defined in HTML. Call the Viewprofile method, and the "Not_allow" error message will pop up!

How can this situation be broken? Is it true that there is no way to spread the public number on its own page?

In fact, we can go around this way:

1, through the micro-trust public platform to push the background of the simplest message, this will generate a separate page, the page can be directly clicked on the nickname Open Public data page, such as this demo independent page

2. On our own page, add a link to the standalone page generated above

Separate pages are similar:

Of course, the above discussion is all about the iphone version of the micro-letter, indeed, the micro-credit iOS webview than the Android WebView do a lot of restrictions.

Next, let's look at how the Android & WP public number is being promoted.

In fact it is very simple (written in my previous blog), is a link to fix:

Click here to add Baidufe public number

Above, you can complete the free spread of the public account on your page!

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.