GoogleSuggest;-) js-based Dynamic drop-down menu _ javascript skills

Source: Internet
Author: User
GoogleSuggest;-) The basic principle of js-based Dynamic drop-down menu is to create an iframe in the current window, and then list the prompts of related keywords in iframe, click in the list and place the selected items in the search box.
The number of searches for all related keywords can be listed so quickly. It seems that all the prompt words have been pre-searched and recorded in advance. I tried sex without any search prompts. It seems that the search term is strictly pornographic.
In addition, this dynamic list function is also applied to the GMail address bar for automatic input. The source code automatically completed by Google is as follows:
// Copyright 2004 and onwards Google Inc. var w = ""; var pa = false; var ta = ""; var da = false; var g = ""; var G = ""; var m = ""; var j =-1; var h = null; var Z =-1; var za = null; var Ca = 5; var q = ""; var Lb = "p "; var Bb = "span"; var la = null; var a = null; var B = null; var Xa = null; var mb = null; var X = null; var ha = null; var ra = false; var kc = null; var hc = null; var Ua = new Object (); var ca = 1; var Aa = 1; var Y = false; var na =-1; var Va = (new Date ()). getTim E (); var Q = false; var k = null; var sa = null; var E = null; var B = null; var aa = null; var Ba = false; var Ka = false; var p = 60; var ia = null; var ya = null; var W = 0; InstallAC = function (frm, scheme, sb, pn, rl, hd, sm, ufn) {la = frm; a = frm; Xa = sb; if (! Pn) pn = "search"; ia = pn; var Kb = "en |"; var Jb = "zh-CN | zh-TW | ja | ko | vi | "; if (! Rl | Kb. indexOf (rl + "|") =-1) rl = "en"; ha = nb (rl); if (Jb. indexOf (ha + "|") =-1) {X = true; Y = false; Ba = false} else {X = false; if (ha. indexOf ("zh") = 0) Y = false; else Y = true; Ba = true} if (! Hd) hd = false; ya = hd; if (! Sm) sm = "query"; w = sm; mb = ufn; ac ()}; function Yb () {ra = true;. blur (); setTimeout ("sfi ();", 10); return} function Fb () {if (document. createEventObject) {var y = document. createEventObject (); y. ctrlKey = true; y. keyCode = 70; document. fireEvent ("onkeydown", y)} function nc (vb) {var y = document. createEventObject (); y. ctrlKey = true; y. keyCode = vb; document. fireEvent ("onkeydown", y)} function gc (event) {} function ic (event) {} function Pb (Event) {if (! Event & window. event) event = window. event; if (event) na = event. keyCode; if (event & event. keyCode = 8) {if (X & (. createTextRange & (event. srcElement = a & (bb (a) = 0 & lb (a) = 0) {cc (a); event. cancelBubble = true; event. returnValue = false; return false }}} function mc () {} function Db () {if (w = "url") {Ha ()} ba ()} function ba () {if (B) {B. style. left = ob (a) + "px"; B. style. top = Qb (a) +. offsetHeight-1 + & quot; px & quot; B. style. width = Ja () + "px"} functi On Ja () {if (navigator & navigator. userAgent. toLowerCase (). indexOf ("msie") =-1) {return. offsetWidth-ca * 2} else {return. offsetWidth} function ac () {if (jb () {Q = true} else {Q = false} if (pa) E = "complete "; else E = "/complete/" + ia; sa = E + "? Hl = "+ ha; if (! Q) {qa ("qu", "", 0, E, null, null)} la. onsubmit = Fa;. autocomplete = "off";. onblur = Ob; if (. createTextRange). onkeyup = new Function ("return okuh (event);"); else. onkeyup = okuh;. onsubmit = Fa; g =. value; ta = g; B = document. createElement ("DIV"); B. id = "completeDiv"; ca = 1; Aa = 1; B. style. borderRight = "black" + ca + "px solid"; B. style. borderLeft = "black" + ca + "px solid"; B. style. borderTop = "black" + Aa + "px solid"; B. style. borderBottom = "Black" + Aa + "px solid"; B. style. zIndex = "1"; B. style. paddingRight = "0"; B. style. paddingLeft = "0"; B. style. paddingTop = "0"; B. style. paddingBottom = "0"; ba (); B. style. visibility = "hidden"; B. style. position = "absolute"; B. style. backgroundColor = "white"; document. body. appendChild (B); Ma ("", new Array (), new Array (); Gb (B); var s = document. createElement ("DIV"); s. style. visibility = "hidden"; s. style. position = "absolute"; s. style. Left = & quot;-10000 & quot; s. style. top = "-10000"; s. style. width = "0"; s. style. height = "0"; var M = document. createElement ("IFRAME"); M. completeDiv = B; M. name = "completionFrame"; M. id = "completionFrame"; M. src = sa; s. appendChild (M); document. body. appendChild (s); if (frames & (frames ["completionFrame"] & frames ["completionFrame"]. frameElement) B = frames ["completionFrame"]. frameElement; else B = document. getElementById ("completionFrame "); If (w = "url") {Ha (); ba ()} window. onresize = Db; document. onkeydown = Pb; Fb ()} function Ob (event) {if (! Event & window. event) event = window. event; if (! Ra) {F (); if (na = 9) {Xb (); na =-1} ra = false} okuh = function (e) {m = e. keyCode; aa =. value; Oa ()}; function Xb () {Xa. focus ()} sfi = function () {. focus ()}; function Wb (va) {for (var f = 0, oa = "", zb = "\ n \ r"; ffunction Qa (I, dc) {var ga = I. getElementsByTagName (Bb); if (ga) {for (var f = 0; ffunction U (I) {if (! I) return null; return Qa (I, "cAutoComplete")} function wa (I) {if (! I) return null; return Qa (I, "dAutoComplete")} function F () {document. getElementById ("completeDiv "). style. visibility = "hidden"} function cb () {document. getElementById ("completeDiv "). style. visibility = "visible"; ba ()} function Ma (is, cs, ds) {Ua [is] = new Array (cs, ds)} sendRPCDone = function (fr, is, cs, ds, pr) {if (W> 0) W --; var lc = (new Date ()). getTime (); if (! Fr) fr = B; Ma (is, cs, ds); var B = fr. completeDiv; B. completeStrings = cs; B. displayStrings = ds; B. prefixStrings = pr; rb (B, B. completeStrings, B. displayStrings); Pa (B, U); if (Ca> 0) B. height = 16 * Ca + 4; else F ()}; function Oa () {if (m = 40 | m = 38) Yb (); var N = lb (a); var v = bb (a); var V =. value; if (X & m! = 0) {if (N> 0 & v! =-1) V = V. substring (0, v); if (m = 13 | m = 3) {var d = a; if (d. createTextRange) {var t = d. createTextRange (); t. moveStart ("character", d. value. length); t. select ()} else if (d. setSelectionRange) {d. setSelectionRange (d. value. length, d. value. length)} else {if (. value! = V) S (V)} g = V; if (Eb (m) & m! = 0) Pa (B, U)} function Fa () {return xb (w)} function xb (eb) {da = true; if (! Q) {qa ("qu", "", 0, E, null, null)} F (); if (eb = "url ") {var R = ""; if (j! =-1 & h) R = U (h); if (R = "") R =. value; if (q = "") document. title = R; else document. title = q; var Tb = "window. frames ['"+ mb +"']. location = \ "" + R + '";'; setTimeout (Tb, 10); return false} else if (eb =" query ") {la. submit (); return true} newwin = function () {window. open (. value); F (); return false}; idkc = function (e) {if (Ba) {var Ta =. value; if (Ta! = Aa) {m = 0; Oa ()} aa = Ta; setTimeout ("idkc ()", 10) }}; setTimeout ("idkc ()", 10 ); function nb (La) {if (encodeURIComponent) return encodeURIComponent (La); if (escape) return escape (La)} function yb (Mb) {var H = 100; for (var o = 1; o <= (Mb-2)/2; o ++) {H = H * 2} H = H + 50; return H} idfn = function () {if (ta! = G) {if (! Da) {var Za = nb (g); var ma = Ua [g]; if (ma) {Va =-1; sendRPCDone (B, g, ma [0], ma [1], B. completeDiv. prefixStrings)} else {W ++; Va = (new Date ()). getTime (); if (Q) {fc (Za)} else {qa ("qu", Za, null, E, null, null ); frames ["completionFrame" 2.16.doc ument. location. reload (true)}. focus ()} da = false} ta = g; setTimeout ("idfn ()", yb (W); return true}; setTimeout ("idfn ()", 10); var Cb = function () {S (U (this); q = wa (this); da = true; Fa ()}; var pb = function () {I F (h) l (h, "aAutoComplete"); l (this, "bAutoComplete")}; var ec = function () {l (this, "aAutoComplete ")}; function Na (C) {g = G; S (G); q = G; if (! Za | Z <= 0) return; cb (); if (C> = Z) {C = Z-1} if (j! =-1 & C! = J) {l (h, "aAutoComplete"); j =-1} if (C <0) {j =-1;. focus (); return} j = C; h = za. item (C); l (h, "bAutoComplete"); g = G; q = wa (h); S (U (h)} function Eb (ja) {if (ja = 40) {Na (j + 1); return false} else if (ja = 38) {Na (J-1 ); return false} else if (ja = 13 | ja = 3) {return false} return true} function Pa (K, ib) {var d =; var T = false; j =-1; var J = K. getElementsByTagName (Lb); var O = J. length; Z = O; za = J; Ca = O; G = g; if (g = "" | O = 0) {F ()} else {cb ()} var AB = ""; I F (g. length> 0) {var f; var o; for (var f = 0; ffunction ob (r) {return Ya (r, "offsetLeft")} function Qb (r) {return Ya (r, "offsetTop")} function Ya (r, ia) {var kb = 0; while (r) {kb + = r [ia]; r = r. offsetParent} return kb} function qa (name, value, Ra, hb, fb, Sb) {var Nb = name + "=" + value + (Ra? "; Expires =" + Ra. toGMTString (): "") + (hb? "; Path =" + hb: "") + (fb? "; Domain =" + fb: "") + (Sb? "; Secure": ""); document. cookie = Nb} function Ha () {var xa = document. body. scrollWidth-220; xa = 0.73 * xa;. size = Math. floor (xa/6.18)} function lb (n) {var N =-1; if (n. createTextRange) {var fa = document. selection. createRange (). duplicate (); N = fa. text. length} else if (n. setSelectionRange) {N = n. selectionEnd-n.selectionStart} return N} function bb (n) {var v = 0; if (n. createTextRange) {var fa = document. selection. createRange (). duplic Ate (); fa. moveEnd ("textedit", 1); v = n. value. length-fa.text.length} else if (n. setSelectionRange) {v = n. selectionStart} else {v =-1} return v} function cc (d) {if (d. createTextRange) {var t = d. createTextRange (); t. moveStart ("character", d. value. length); t. select ()} else if (d. setSelectionRange) {d. setSelectionRange (d. value. length, d. value. length)} function jc (Zb, Ea) {if (! Ea) Ea = 1; if (pa & pa <= Ea) {var Ia = document. createElement ("DIV"); Ia. innerHTML = Zb; document. getElementById ("console "). appendChild (Ia)} function l (c, name) {db (); c. className = name; if (Ka) {return} switch (name. charAt (0) {case "m": c. style. fontSize = "13px"; c. style. fontFamily = "arial, sans-serif"; c. style. wordWrap = "break-word"; break; case "l": c. style. display = "block"; c. style. paddingLeft = "3"; c. style. paddingRight = "3"; c. styl E. height = "16px"; c. style. overflow = "hidden"; break; case "a": c. style. backgroundColor = "white"; c. style. color = "black"; if (c. displaySpan) {c. displaySpan. style. color = "green"} break; case "B": c. style. backgroundColor = "# 3366cc"; c. style. color = "white"; if (c. displaySpan) {c. displaySpan. style. color = "white"} break; case "c": c. style. width = p + "%" Export c.style.css Float = "left"; break; case "d": c.style.css Float = "right"; c. style. width = 1 00-p + "%"; if (w = "query") {c. style. fontSize = "10px"; c. style. textAlign = "right"; c. style. color = "green"; c. style. paddingTop = "3px"} else {c. style. color = "#696969"} break} function db () {p = 65; if (w = "query") {var wb = 110; var Sa = Ja (); var tb = (Sa-wb)/Sa * 100; p = tb} else {p = 65} if (ya) {p = 99.99} function Gb (I) {db (); var Ub = "font-size: 13px; font-family: arial, sans-serif; word-wrap: break-word; "; var Vb =" display: block; padding-le Ft: 3; padding-right: 3; height: 16px; overflow: hidden; "; var bc =" background-color: white; "; var qb =" background-color: # 3366cc; color: white! Important; "; var ub =" display: block; margin-left: 0%; width: "+ p +" %; float: left; "; var Ga =" display: block; margin-left: "+ p +" %; "; if (w =" query ") {Ga + =" font-size: 10px; text-align: right; color: green; padding-top: 3px; "} else {Ga + =" color: #696969; "} D (". mAutoComplete ", Ub); D (". lAutoComplete ", Vb); D (". aAutoComplete * ", bc); D (". bAutoComplete * ", qb); D (". cAutoComplete ", ub); D (". dAutoComplete ", Ga); l (I," mAutoComp Lete ")} function rb (I, cs, Hb) {while (I. childNodes. length> 0) I. removeChild (I. childNodes [0]); for (var f = 0; ffunction D (name, gb) {if (Ka) {var I = document. styleSheets [0]; if (I. addRule) {I. addRule (name, gb)} else if (I. insertRule) {I. insertRule (name + "{" + gb + "}", I .css Rules. length) }}function jb () {var A = null; try {A = new ActiveXObject ("Msxml2.XMLHTTP")} catch (e) {try {A = new ActiveXObject ("Microsoft. XMLHTTP ")} catch (oc) {A = nu Ll} if (! A & typeof XMLHttpRequest! = "Undefined") {A = new XMLHttpRequest ()} return A} function fc (Rb) {if (k & k. readyState! = 0) {k. abort ()} k = jb (); if (k) {k. open ("GET", sa + "& js = true & qu =" + Rb, true); k. onreadystatechange = function () {if (k. readyState = 4 & k. responseText) {var frameElement = B; if (k. responseText. charAt (0) = "<") {W --} else {eval (k. responseText) }}; k. send (null)} function S (Wa) {. value = Wa; aa = Wa}
The source code is very "crowded" and I have to use the following code to do beautifier: perl-pe's/; \ n/G' ac. js | perl-pe's/} \ n/G' | perl-pe's/{\ n/G'> ac.js.txt attachment: you tried to change 26 English letters from A ~ Z input, which words will be ranked first: a --- amazonb --- best buyc --- cnnd --- Example --- ebayf --- firefoxg --- gamesh --- hotmaili --- ikeaj --- jokesk --- kazaal --- lyricsm --- newso --- online dictionaryp --- paris hiltonq --- quotesr --- recipess --- spybott --- tara reidu --- upsv --- verizonw --- weatherx --- xboxy --- yahooz --- zip codes

Chelong [1] and huttmean [2] Both talk about the benefits of google's search recommendations.
[1] http://www.chedong.com/blog/archives/000028.html#more
[2] http://www.hutteman.com/weblog/2004/12/10-217.html

Chelong says better. Code is returned. It is worthy of the technical team.

I don't care about this feature. :) Gmail is good.
Yes, because you don't have to remember the email address. Just
Like using a local email program. Google's usefulness
Not big.

I want to ask these questions. I am not a technical engineer
It is more zhener School. :)

In google, there are not only prompts but also records that have been searched by memory.
(Or is this the memory of the browser ?)

1) For privacy reasons, I want to disable google Search
Show and/or memory. 2) I will not disable it. However
Now we have to use it for another user. How can I clear the search?
Cable memory. 3) further. I want google to think of me
This is to use another machine to access the Internet.
Is the cookie left by google enough? If it is
How to find the cookie. If not, what should I do?
?

Maybe some of the questions you asked are incorrect. Guess me.
What is the question .:)

Not everyone can have one computing task for their own use.
Machine. And public computers (such as in a shared office)
And Library) this privacy issue will be more prominent.

Gmail has been criticized for privacy issues (of course its
Some other email service providers are not as good as gmail .)
Now google is so amazing, maybe it's better than yourself
Understand what you are doing online. You said so.
? Che Dong?

Reply:
Http://www.chedong.com/blog/archives/000028.html#more

It is better to reply to CC emails. Hehe
Preventing google from disclosing too much user privacy is a topic of interest to many people.

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.