String path = request.getContextPath();
String basePath = request.getScheme() "://" request.getServerName() ":" request.getServerPort() 路徑 "/";
%>
渡//EN">
喝喝標題>
var imgUrl = 'http://qqfood.tc.qq.com/meishio/16/4585bf7c-be04-420f-ac8a-2dba61a7561f/0';
var lineLink = 'http://life.qq.com/weixin/r/lottery/13826036970196242008#wechat_redirect';
var descContent = "萬達狂歡節,奪寶幸運星大抽獎活動開始囉!";
var shareTitle = '萬達狂歡節';
var appid = 'wxc9937e3a66af6dc8';
函數 shareFriend() {
WeixinJSBridge.invoke('sendAppMessage',{
「appid」:appid,
「img_url」:imgUrl,
"img_width": "640",
"img_height": "640",
「連結」:lineLink,
「desc」:描述內容,
“標題”:分享標題
}, 函數(res) {
_report('send_msg', res.err_msg);
})
}
函數 shareTimeline() {
WeixinJSBridge.invoke('shareTimeline',{
「img_url」:imgUrl,
"img_width": "640",
"img_height": "640",
「連結」:lineLink,
「desc」:描述內容,
“標題”:分享標題
}, function(res) {
_report('timeline', res.err_msg);
;
});
}
function shareWeibo() {
WeixinJSBridge.invoke('shareWeibo',{
"content": descContent,
"url": lineLink,
}, function(res) {
_report('weibo', res.err_msg);
});
}
// 當微信內建瀏覽器完成內部初始化後會觸發WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 寄給好友
WeixinJSBridge.on('menu:share:appmessage', function(argv){
shareFriend();
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function(argv){
shareTimeline();
});
// 分享至微博
WeixinJSBridge.on('menu:share:weibo', function(argv){
shareWeibo();
});
}, false);
頭>
呵呵呵呵