CodeExample:
<A href = "http://sighttp.qq.com/cgi-bin/check? Sigkey = blank "; target = _ blank; onclick =" Var tempsrc = 'HTTP: // sighttp.qq.com/wpa.js? Rantime = '+ math. random () + '& sigkey = comment'; 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. paren Tnode. replaceChild (newscript, oldscript);} return false; "> </a> |
1) The sigkey is the personal authentication key. Do not modify it; otherwise, a temporary session cannot be initiated.
2) temporary session icon
SRC is the icon link. You can replace this part of the custom icon with the link of your own image,
Parameters:
P = separate multiple parameters with the colon ":"
The first parameter is the version number, which is currently 1;
The second is the QQ/TM number;
The third parameter is the image style and supports multiple States.
ALT is the message next to the icon.
3) In addition to the custom icon, we recommend that you do not modify the code in other cases, because it may lead to the inability to initiate a temporary session in different environments and browsers.
Custom online style images
Follow these steps:
1) application code
<A href = "http://sighttp.qq.com/cgi-bin/check? Sigkey = blank "; target = _ blank; onclick =" Var tempsrc = 'HTTP: // sighttp.qq.com/wpa.js? Rantime = '+ math. random () + '& sigkey = comment'; 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. paren Tnode. replaceChild (newscript, oldscript);} return false; "> </a> |
2) define the online array, which must be named online.
<SCRIPT> var online = new array (); </SCRIPT>
3) obtain the online status
<SCRIPT src = "http://webpresence.qq.com/getonline? Type = 1 & 80000805: "> </SCRIPT>
Multiple IDs can be obtained, which must be separated by colons and end with colons. For example:
<SCRIPT src = "http://webpresence.qq.com/getonline? Type = 1 & 80000805: 10000: 123456: "> </SCRIPT>
Online [0] = 0, indicating 80000805 offline
Online [1] = 1, indicating 10000 online
Online [2] = 1, indicating 123456 online
Enter the order of numbers, corresponding to the array online 0, 1, 2
4) Add code
Set src = 'HTTP: // wpa.qq.com/pa? P = 1: 80000805: 1' is replaced with your own image, for example:
<SCRIPT> If (online [0] = 0) document. Write ("<a href =" http://sighttp.qq.com/cgi-bin/check? Sigkey = blank "; target = _ blank; onclick =" Var tempsrc = 'HTTP: // sighttp.qq.com/wpa.js? Rantime = '+ math. random () + '& sigkey = comment'; 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> "); Else document. Write ("<a href =" http://sighttp.qq.com/cgi-bin/check? Sigkey = blank "; target = _ blank; onclick =" Var tempsrc = 'HTTP: // sighttp.qq.com/wpa.js? Rantime = '+ math. random () + '& sigkey = comment'; 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> "); </SCRIPT> |