O código é muito simples, não vou falar muito bobagem aqui, basta apresentar o código -fonte:
A cópia do código é a seguinte:
<%@ Page Language = "java" import = "java.util.*" PageEncoding = "utf-8"%>
<%
String path = request.getContextPath ();
String basalepath = request.getScheme ()+": //"+request.getServername ()+":"+request.getServerport ()+path+"/";
%>
<!
<html>
<head>
<base href = "<%= bashepath%>">
<title> beba </title>
<meta http-equiv = "Pragma" content = "no-cache">
<meta http-equiv = "cache-control" content = "no-cache">
<meta http-equiv = "expira" content = "0">
<meta http-equiv = "palavras-chave" content = "palavra-chave1, palavra-chave2, palavra-chave3">
<meta http-equiv = "description" content = "Esta é a minha página">
<!-
<link rel = "Stylesheet" type = "text/css" href = "styles.css">
->
<Cript>
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 = "Wanda Carnival, a Lucky Treasure Lottery começou!";
var sharetitle = 'wanda carnival';
var appid = 'wxc9937e3a66af6dc8';
function sharefriend () {
Weixinjsbridge.invoke ('SendAppMessage', {
"Appid": Appid,
"img_url": imgurl,
"img_width": "640",
"img_height": "640",
"Link": linelink,
"Desc": desccontent,
"Título": Sharetitle
}, function (res) {
_report ('send_msg', res.err_msg);
})
}
função sharetimeline () {
Weixinjsbridge.invoke ('sharetimeline', {
"img_url": imgurl,
"img_width": "640",
"img_height": "640",
"Link": linelink,
"Desc": desccontent,
"Título": Sharetitle
}, function (res) {
_report ('Linha do tempo', res.err_msg);
});
}
function shareweibo () {
Weixinjsbridge.invoke ('shareweibo', {
"Conteúdo": Desccontent,
"url": linelink,
}, function (res) {
_report ('weibo', res.err_msg);
});
}
// Quando o navegador WeChat embutido conclui a inicialização interna, o evento Weixinjsbridgeready será acionado.
document.addeventListener ('weixinjsbridgeready', function onbridgeready () {
// Envie para amigos
Weixinjsbridge.on ('menu: compartilhe: appMessage', function (argv) {
sharefriend ();
});
// Compartilhe com amigos
Weixinjsbridge.on ('menu: compartilhe: linha do tempo', função (argv) {
sharetimeline ();
});
// Compartilhe no Weibo
Weixinjsbridge.on ('menu: compartilhe: weibo', function (argv) {
shareweibo ();
});
}, false);
</script>
</head>
<Body>
<!- <Script>
var imgurl = "http://tkfeng.hk.myjsp.wang/jianwuye/img/avatar1.jpg";
var lineLink = "http://tkfeng.hk.myjsp.wang/jianwuye/login.html";
var desccontent = 'Não leve o teste a sério';
var sharetitle = 'compartilhar';
var appid = 'wx1259b351c201841d';
function sharefriend () {
Weixinjsbridge.invoke ('SendAppMessage', {
"Appid": Appid,
"img_url": imgurl,
"img_width": "200",
"img_height": "200",
"Link": linelink,
"Desc": desccontent,
"Título": Sharetitle
}, function (res) {
// _ Relatório ('send_msg', res.err_msg);
});
}
função sharetimeline () {
Weixinjsbridge.invoke ('sharetimeline', {
"img_url": imgurl,
"img_width": "200",
"img_height": "200",
"Link": linelink,
"Desc": desccontent,
"Título": Sharetitle
}, function (res) {
// _ Relatório ('Linha do tempo', res.err_msg);
});
}
function shareweibo () {
Weixinjsbridge.invoke ('shareweibo', {
"Conteúdo": Desccontent,
"url": linelink,
}, function (res) {
// _ Relatório ('weibo', res.err_msg);
});
}
// Quando o navegador WeChat embutido conclui a inicialização interna, o evento Weixinjsbridgeready será acionado.
document.addeventListener ('weixinjsbridgeready', function onbridgeready () {
// Envie para amigos
Weixinjsbridge.on ('menu: compartilhe: appMessage', function (argv) {
sharefriend ();
});
// Compartilhe com amigos
Weixinjsbridge.on ('menu: compartilhe: linha do tempo', função (argv) {
sharetimeline ();
});
// Compartilhe no Weibo
Weixinjsbridge.on ('menu: compartilhe: weibo', function (argv) {
shareweibo ();
});
}, false);
</script> ->
<H1> hahaha </h1>
</body>
</html>
Não é muito útil? Amigos? Todos os embelezam e usam em seus próprios projetos