经常需要用到 QQ 头像,做个小笔记

1
2
3
<input type="number" id="qq" />
<button id="button1">获取头像</button>
<img id="img1" src="" />
1
2
3
button1.onclick = function () {
img1.src = "http://q1.qlogo.cn/g?b=qq&nk=" + qq.value + "&s=640"; //&s是尺寸 有40 100 140 640
};