天天看点

H5跳转微信公众号关注页面

微信公众号的页面地址(示例):

可以通过

location.href

的方式直接跳转过去。

<div class="p:32 text-center">
    <button id="btn1" class="btn btn-main">关注公众号1</button>
</div>
<div class="p:32 text-center">
    <a id="btn2" onclick="location.href='qrimg_url';" class="btn btn2">关注公众号2</a>
</div>
<script>
Q('btn1').onclick = function() {
    location.href= 'qrimg_url';
}
</script>