But Tencent's version of this page has changed, and I discovered it today. With the previous code has not been able to click to open the Chat window, the generated new code longer than before, a bit more sigkey,64 (very long).
Take my QQ as an example, the code generated on that page is as follows:
Copy Code code as follows:
<a href= "Http://sighttp.qq.com/cgi-bin/check?sigkey=cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2"; 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; ></a>
Isn't it long? And so put into the Web page, then the page must not be authenticated, SRC is capitalized, and so on; Target=_blank; ”。 If you want to put several QQ, that page is also very messy. What to do?
I compared two QQ, found that only the 64-bit sigkey is not the same, so you can move the onclick out, code:
Copy Code code as follows:
<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>
Then direct onclick= "return Qqtalk (' Cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2 ');"
The code within the body of the Web page can be written as: <a href= "http://sighttp.qq.com/cgi-bin/check?sigkey= Cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2 "target=" _blank "onclick=" return QQtalk (' Cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2 '); " ></a>