Implementation of website instant messages

Source: Internet
Author: User

First, add a hidden page to the framework, as shown below:

<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> </title>
<Script language = "JavaScript">
Function re ()
{
Window. setTimeout ("re ()", 30000 );
Iframepopmsg.doc ument. Location. href = "search. asp"
}
</SCRIPT>
</Head>
<Body topmargin = "0" leftmargin = "0" onLoad = "re ();">
<IFRAME Height = "1" scrolling = "no" frameborder = "0" width = "1" id = "iframepopmsg" src = "about: blank"> </iframe>
</Body>
</Html>

The function of this page is not to refresh the search. ASP page every 30000 milliseconds. Below is the search. aspCode

<Head>
<%
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select ID from XXXX where XXXX"
Rs. Open SQL, Conn, 3, 2
If not Rs. EOF then
%>
<Script language = "JavaScript">
Newwin = Window. Open ("New. asp? Id = <% = RS ("ID") %> "," "," Top = 50, Left = 50, width = 420, Height = 262, menubar = No, status = No, scrollbars = Yes, location = No, toolbar = No ")
Newwin. Focus ();
</SCRIPT>
<%
End if
Rs. Close
Set rs = nothing
Connend
%>
</Head>

In this way, if there is a message that meets the query conditions, the new. ASP page will pop up, And the ID will be passed over. The following is how the pop-up page is displayed, which is not detailed here.

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.