日期:2014-05-17 浏览次数:21029 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" charset="utf-8" data-callback="true"></script>
<script src="/js/qq.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<script type="text/javascript"> getToken()</script>
</div>
</form>
</body>
</html>
var arrqq = new Array();
arrqq[0] = "1";
arrqq[1] = "11";
arrqq[2] = "111";
function getnickname() {
if (QC.Login.check()) {
QC.api("get_user_info", paras)
.success(function (s) {//成功回调
alert("获取用户信息成功!当前用户昵称为:" + s.data.nickname);
arrqq[2] = s.data.nickname;
//return s.data.nickname;
alert(arrqq[2]);
})
.error(function (f) {//失败回调
//alert("获取用户信息失败!");
})
.complete(function (c) {//完成请求回调
//alert("获取用户信息完成!");
});
} else {
alert("请登录后体验");
}
}
function getToken() {
if (QC.Login.check()) {
QC.Login.getMe(function (openId, accessToken) {
//alert(["当前登录用户的", "openid为:" + openId, "accessToken为:" + accessToken].join("\n"));