码迷,mamicode.com
首页 > 微信 > 详细

微信接口

时间:2015-01-13 12:08:44      阅读:312      评论:0      收藏:0      [点我收藏+]

标签:

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script>
var imgUrl = "http://www.linzmei.com/2015newyear/3.jpg";

var lineLink = "http://www.linzmei.com/2015newyear";
var descContent = "2015 HAPPY NEW YEAR"; //分享给好友的时候显示标题和描述,分享到朋友圈只显示标题
var shareTitle = "2015 HAPPY NEW YEAR";
var appid = "";

var share = {
shareFriend: function () {
WeixinJSBridge.invoke(‘sendAppMessage‘, {
"appid": appid,
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function (res) {
//_report(‘send_msg‘, res.err_msg);
})
},
//分享到朋友圈
shareTimeline: function () {
WeixinJSBridge.invoke(‘shareTimeline‘, {//
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function (res) {
//_report(‘timeline‘, res.err_msg);
});
}
}


document.addEventListener(‘WeixinJSBridgeReady‘, function onBridgeReady() {//

//发送给好友
WeixinJSBridge.on(‘menu:share:appmessage‘, function (argv) {
share.shareFriend();
});
//分享到朋友圈
WeixinJSBridge.on(‘menu:share:timeline‘, function (argv) {
share.shareTimeline();
});

}, false);

 

 

 

</script>
<script type="text/javascript">
$(function()
{

var h = document.documentElement.clientHeight;//获取页面可见高度

$(".aaa").css("height",h);

//当浏览器窗口大小改变时,设置显示内容的高度

window.onresize=function(){
changeDivHeight();
}
function changeDivHeight(){
h = document.documentElement.clientHeight;//获取页面可见高度
$(".aaa").css("height",h);




}
})


</script>

 

<body>

<div style="height: 0px;"> <img height="0" width="0" src="3.jpg"> </div>

 

</body>

 

微信接口

标签:

原文地址:http://www.cnblogs.com/zmeieasyjob/p/4220681.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!