欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

QQ在線狀態(tài)代碼

 更新時間:2008年09月04日 13:57:46   作者:  
大家都知道騰訊有個互動狀態(tài)代碼生成頁,http://is.qq.com/webpresence/code.shtml,能很方便的生成互動按鈕。
但是騰訊的這個頁面改過版了,我是今天才發(fā)現(xiàn)的。用以前的代碼已經(jīng)不能點擊打開聊天窗口了,生成的新代碼比以前長了,多了個sigkey,64位的(好長 )。
以我的QQ為例子,在那個頁面生成的代碼如下:
復制代碼 代碼如下:

<a ; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:56536321:2' alt="56536321"></a>

是不是很長?而且就這樣放進網(wǎng)頁,那么頁面肯定過不了W3C認證,SRC是大寫,再如“;target=_blank; ”。如果要放好幾個QQ,那頁面豈不是也很亂。怎么辦?
我對比了兩個QQ,發(fā)現(xiàn)只有那個64位的sigkey不一樣,所以可以把onclick移出來,代碼: 
復制代碼 代碼如下:

<script type="text/javascript">
function QQtalk(sigkey) {
var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey='+sigkey;
var oldscript=document.getElementById('testJs');
var newscript=document.createElement('script');
newscript.setAttribute('type','text/javascript');
newscript.setAttribute('id', 'testJs');
newscript.setAttribute('src',tempSrc);
if(oldscript == null) {
document.body.appendChild(newscript);
}
else {
oldscript.parentNode.replaceChild(newscript, oldscript);
}
return false;
}
</script>

然后直接onclick="return QQtalk('cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2');"

網(wǎng)頁body內(nèi)的代碼可以寫成: <a target="_blank" onclick="return QQtalk('cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2');"><img src="http://wpa.qq.com/pa?p=1:56536321:3" alt="56536321"></a>

相關(guān)文章

最新評論