Javascript _ javascript tips

Source: Internet
Author: User
This article mainly introduces how to flash the webpage title when JavaScript achieves a message. The example shows how to use JavaScript to dynamically operate page elements based on time functions, with the title flashing solution provided by kaixin.com, you can refer to the example in this article to describe how to flash the webpage title when JS achieves a message. We will share this with you for your reference. The details are as follows:

No title pageScript var g_blinkid = 0; var g_blinkswitch = 0; var g_blinktitle = document. title; var g_onlineuser = ""; var g_sysmsg_sound = null; var g_newmsg_sound = null; var g_app_num = 0; var g_appnum = 0; var g_bappmore = false; var g_inputtime = 0; function blinkNewMsg () {document. title = g_blinkswitch % 2 = 0? "[]-" + G_blinktitle: "[new message]-" + g_blinktitle; g_blinkswitch ++;} g_blinkid = setInterval (blinkNewMsg, 1000); function stopBlinkNewMsg () {if (g_blinkid) {clearInterval (g_blinkid); g_blinkid = 0; document. title = g_blinktitle;} script  

See kaixinnet head-26.js

Var g_blinkid = 0; var g_blinkswitch = 0; var g_blinktitle = document. title; var g_onlineuser = ""; var g_sysmsg_sound = null; var g_newmsg_sound = null; var g_app_num = 0; var g_appnum = 0; var g_bappmore = false; var g_inputtime = 0; function blinkNewMsg () {var now = new Date (); var nowtime = now. getTime (); if (nowtime-g_inputtime> 5000) {document. title = g_blinkswitch % 2? "[]-" + G_blinktitle: "[new message]-" + g_blinktitle;} g_blinkswitch ++;} function blinkOnline () {document. title = g_blinkswitch % 2? "○" + G_onlineuser + "online-" + g_blinktitle: "●" + g_onlineuser + "online-" + g_blinktitle; g_blinkswitch ++; if (g_blinkswitch> 10) {stopBlinkNewMsg () ;}} function checkNewMsg () {var url = "/home/newmsg. php "; var pars =" "; var myAjax = new Ajax. request (url, {method: "post", parameters: pars, onComplete: function (req) {checkNewMsgShow (req) ;}} function stopBlinkNewMsg () {if (g_blinkid ){ ClearInterval (g_blinkid); g_blinkid = 0; $ ("head_msgp "). style. display = "none"; document. title = g_blinktitle;} var g_oldmsg = g_oldsysmsg = g_oldbbs = g_oldbbsreply = g_oldcomment = g_oldreply = 0; function checkNewMsgShow (req) {var r = req. responseText; stopBlinkNewMsg (); setTimeout (checkNewMsg, 60000); eval ("r =" + r); var a_msglist = new Array ("msg", "sysmsg ", "bbs", "bbsreply", "comment", "repl Y "); if (r. notice =" 1 ") {var forbidsound = parseInt (r. forbidsound); if (! Forbidsound) {for (I = 0; I '+'

'+'

'+'

'+'

'+'

'+'

'+'

Homepage

'+'

'+'

'+'

'+'

My homepage

'+'

'+'

My homepage preview:

'+'

'+ ''+'

'+'

When a friend accesses

'+'

'+ ''+'

'+'

'+ ''+'

'+'

When a stranger visits

'+'

'+ ''+'

'+'

'+'

'+'

'+ ''+'

'+'

Friend

'+'

'+'

'+' '+'

'+'

All my friends

'+'

Current online friend

'+'

Friend Management

'+'

Friend status update

'+'

'+'

Invite friends

'+'

Find friends

'+'

'+'

'+'

'+ ''+'

'+'

Group

'+'

'+'

'+'

'+'

My Group

'+'

Group of Friends

'+'

'+'

Create new group

'+'

All groups

'+'

'+'

'+'

'+ ''+'

'+'

Message

'+'

'+'

'+'

'+'

Short Message

'+'

System message

'+'

'+'

Comment

'+'

Reply to comment

'+'

Message Board

'+'

Message reply

'+'

'+'

'+'

'+ ''+'

'+'

'+'

Invite a registrant to seek out the account, and then log out.

'+'

'+'

'+'

'+'

'+'

'+'

'+'

'+'

'+'

'; Document. writeln (v_html);} function _ outputApp (v_icon, v_link, v_title, v_aid, v_index_num) {if (-1 = v_link.indexOf ("? ") {V_link + = "? T = "+ Math. ceil (Math. random () * 100);} else {v_link + = "& t =" + Math. ceil (Math. random () * 100);} v_html ='

'+'

'+ V_title +'

'+'

'+'

'+'

'; Return v_html;} function outputApp (v_icon, v_link, v_title, v_aid, v_index_num) {document. writeln (_ outputApp (v_icon, v_link, v_title, v_aid, v_index_num);} function _ setApplistHiddenHead () {if (g_app_num =-1) return ''; g_appnum ++; if (g_appnum> g_app_num &&! G_bappmore) {g_bappmore = true; return '';} function setApplistHiddenHead () {document. writeln (_ setApplistHiddenHead ();} function _ setApplistHiddenTail () {if (g_app_num =-1) return ''; if (g_bappmore) {return'

Expand

';} Return '';} function setApplistHiddenTail () {document. writeln (_ setApplistHiddenTail ();} function outputHead2 () {document. write ('

Click here to add various practical or game components

Add component

Component settings

');} Function showAppmore () {if ($ ("applistmore "). style. display = "none") {$ ("applistmore "). style. display = "block"; $ ("applistscroll "). innerHTML = 'collapse ';} else {$ ("applistmore "). style. display = "none"; $ ("applistscroll "). innerHTML = 'expand ';} function outputAppInfo () {if (g_allapp_num> g_prevapp_num) {var url = "/app/left. php "; var pars =" "; var myAjax = new Ajax. request (url, {method: "post", parameters: pars, onComplete: function (req) {outputAppInfoAjaxShow (req) ;}}} function outputAppInfoAjaxShow (req) {eval ("data =" + req. responseText); var v_html = ''; for (var I = 0; I

'+'

'+'

'+'

Feedback on our renewal contact information: Renewal help center©2009 kaixin001.com Jing ICP Certificate No. 080482

'+'

');}

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.