Online status code details and how to customize online style picture http://wp.qq.com/index.html

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.