Ajax make Web page right bottom corner pop-up hint effect

Source: Internet
Author: User
Tags add end integer string window

Remember to do automatic reminders are used in an IFRAME frame, in a frame constantly refreshed. Detects if there is a new message. However, when using a reminder similar to MSN, pop-up balloon information is displayed in the IFRAME frame. That is, when the IFRAME frame is not visible, The message is not visible. And the overall page effect also consider some browser support for the framework.

The use of Ajax (Dynamic Web site static) technology is described in two parts. The first is the background processing. Here I am downloading Ajax (Dynamic Web site static) DLL files on the Web (schwarz-interactive.de, Michael Schwarz, Version 5.7.22.2), reducing the time to write Ajax (Dynamic Web static) common.

Background code is relatively simple to open. A reference to Ajax (Dynamic Web site static). dll (Webconfig need to add the processing of ashx). Add one line of code to the Load (Page_Load) of the call page, I use the page for index.aspx ( Class is index)

Ajax (Dynamic Web site static). Utility.registertypeforajax (Dynamic Web site Static) (GetType (index))
Then add a function that requires notification. The following is a function of notification of a message. String type returns the message.

<ajax (dynamic website static). Ajax (Dynamic Web site Static) method () > Public Function getdealmessageshow (ByVal v As String) As String Dim userid as Integer Try userid = CType (V, Integer) REM V for personal ID information Catch ex as Exception Exit Function end Try Dim value as String = Dat ACLs. Email_topdealinfo (userid) REM data processing in Datacls return value end Function
It is necessary to add <ajax (Dynamic Web site static). Ajax (Dynamic Web site Static) method () > and Use public declaration, I used friend. Prompts an error.

This backstage program is complete. Now add JavaScript calls to the foreground page.

function Checkisnewsysteminfo () {var V=document.getelementbyid (' Hiddenuserid '). InnerHTML index. Getdealmessageshow (V,getdealmessageshow_callback); Index is consistent with the background registertypeforajax (Dynamic Web site static) type. function Getdealmessageshow_callback (res) {var s=res.value; if (s!= ' && s!=null) {var strtmp=s.split ("|"); doc Ument.getelementbyid (' Popupwin1titleel '). InnerHTML = '::::: (System Hint::::: '; document.getElementById (' popupwin1acnt '). innerhtml= ' <span id=popupwin1_emailid> ' +strTmp[0]+ ' </span> ' +strtmp[1]; STRTMP[0] is the ID, mainly is used to close the prompt window to remove the alert information, strtmp[1] is the content popupwin1espopup_winload (); } }
Add a section of JavaScript at the bottom of the page to automatically read the server information every 5 seconds.

Window.setinterval ("Checkisnewsysteminfo ()", 5000);
Finally, add the hint box code. There are more online. Here is a pop-up prompt box similar to the bottom right corner of MSN.



Related Article

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.