Page code:
JS Code:
1 functionSwt_hm (text) {2 3 //Please replace the "Generate code-link address" in the link address, do not go to other places to copy4 5Kschatlink = ' Http://kefu6.kuaishang.cn/bs/im.htm?cas=29935___399142&fi=32136&ism=1 ';6 7 //var ksuserdefinedopennewchatwin=true;8 9 //Verify that the parameter existsTen One functioncheckquerystring (params,name) { A - if(!params)return false; - the return NewRegExp ("(^|&)" + name + "= ([^&]*) (&|$)", "I"). Test (params); - - } - + //get URL parameter value - + functiongetquerystring (url,name) { A at varindex = Url.indexof ('? ')); - - if(Index==-1)return‘‘; - -Url=url.substr (index+1, url.length); - in varReg =NewRegExp ("(^|&)" + name + "= ([^&]*) (&|$)", "I"); - to varR =Url.match (reg); + - if(r! =NULL)return(r[2]); the * return‘‘; $ Panax Notoginseng } - the varOpennewchatwin; + A varLocalarr = Kschatlink.split ("?")); the +Localarr.push (""); - $ if(typeofksuserdefinedopennewchatwin!= ' undefined ' && ksuserdefinedopennewchatwin==true){ $ -Opennewchatwin =true; - the}Else if(Checkquerystring (localarr[1], ' ism ')){ - WuyiOpennewchatwin =false; the -}Else{ Wu -Opennewchatwin =true; About $ } - - //Open the Quick Undertaker Chat window link - A functionKsopenlink () { + the varAppendtailurl= "; - $ Try{ the the varcas = getquerystring (kschatlink, ' cas '); the the if(CAS) { - in varVi= "; the the varDC = Document.cookie.match (NewRegExp (' (^|) ' + cas+ ' _ks_ ' +cas + ' = ([^;] *) (; |$) ')); About the if(DC! =NULL){ the theVI = (dc[2]); + - } the Bayi if(vi) { the theAppendtailurl + = ' &vi= ' +VI; - - } the the } the the}Catch(e) {} - the varRef= ""; the the Try{if(opener.document.referrer.length>0) {ref=opener.document.referrer;}}Catch(e) {ref=Document.referrer;}94 the if(!ref | | ref.length==0) {ref=Document.referrer;} the the //Dialogue URL98 AboutAppendtailurl + = ' &dp= ' +encodeURIComponent (window.location.href); - 101 //Visitor Sources102 103 if(ref) appendtailurl+= ' &ref= ' +encodeURIComponent (ref);104 the //Dialog ID106 107 if(text) appendtailurl+= ' &stext= ' +encodeuricomponent (text);108 109 if(Kschatlink.indexof ('? ') ==-1) {appendtailurl=appendtailurl.substring (1) + '? ';} the 111kschatlink+=Appendtailurl; the 113 //Open Chat window based on Opennewchatwin settings the the if(!Opennewchatwin) { the 117window.location.href=Kschatlink;118 119}Else{ - 121 varKswin = window.open (kschatlink, ' _blank ');122 123 if(Kswin) {124 the Try{Kswin.focus ();}Catch(e) {}//position the focus to the chat window126 127 } - 129 } the 131 } the 133 //Use the default Open Chat window event If the fast commercial pass code is loaded, otherwise use the custom Open event134 135 if(typeofks!= ' undefined '){136 137 varp = {};138 139 if(text) p[' stext ']=text; $ 141 if(Opennewchatwin) p[' otarget ']= ' _blank ';142 143 Try{144 145 if(typeofks.openchatwin== ' function '){146 147 Ks.openchatwin (p);148 149}Else if(typeofks.openchatlink== ' function '){ Max 151 Ks.openchatlink (p); the 153}Else{154 155 Ksopenlink ();156 157 }158 159}Catch(e) { the 161 Ksopenlink ();162 163 }164 165}Else{166 167 Ksopenlink ();168 169 } the 171}
View Code
This article was reproduced in: http://blog.sina.com.cn/s/blog_bddd59750102x5sz.html
Quick Business Pass Code