<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Body>
<! --
<Textarea id = "debug" style = "width: 500px; height: 350px;">
</Textarea>
-->
<B> Dict.cn </B>
<Input onKeyUp = if (event. keyCode = 13) this. nextSibling. nextSibling. click ()> <input type = "button" value = 'search' onclick = "if (TV = this. previussibling. previussibling. value) dict (TV) ">
<Div id = "temptrans" style = "display: block;"> <br>
The vocabulary is derived from <a href = http://dict.cn> dict.cn </a> <p align = right style = 'padding-right: Adjust PX; color: green'>
Buglol </p>
</Div>
<Script>
Var $ = function (hook) {return document. getElementById (hook );}
Function unhtmlspecialchars (str ){
F = new Array (/& lt;/g,/& gt;/g,/"/g,/&/g );
R = new Array ('<', '> ','"','&');
For (var I = 0; I <f. length; I ++ ){
Str = str. replace (f [I], r [I]);
}
Return str. replace (/'/g ,"'");
}
Function htmlspecialchars (str ){
Var f = new Array (new RegExp ('&', 'G'), new RegExp ('<', 'G'), new RegExp ('> ', 'G'), new RegExp ('"', 'G '));
Var r = new Array ('&', '& lt;', '& gt ;','"');
For (var I = 0; I <f. length; I ++ ){
Str = str. replace (f [I], r [I]);
}
Return str. replace ("'",/'/g );
}
Function dict (v, s)
{
Try
{
Ax. loadHttp ("http://dict.cn/search? Q = "+ decodeURI (v) + (s? "& R =" + s: ""), true, function ()
{
Var retTxt = Ax. Bin2Str (arguments [0]. responseBody );
// $ ("Debug"). value = shiftRelevantInterpretation (shiftHref (stripIMG (getIWanted (Ax. Bin2Str (arguments [0]. responseBody )))));
If (! /DictAdd/gi. test (retTxt ))
{
// $ ("Temptrans"). innerHTML = "sorry, this word is not found! ";
// DivChangeText ('ssssdiv ',' <font size = "2" face = "Trebuchet MS"> 1. <a href = ./? Q = campaign & r = compaign> campaign </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 2. <a href =. /? Q = copain & r = compaign> copain </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 3. <a href =. /? Q = complain & r = compaign> complain </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 4. <a href =. /? Q = complin & r = compaign> complin </a> </font> <br> try the near-tone keyword query <a href = ./? Q = % 5 Bcompaign % 5D> [compaign] </a>? ');
If (! /DivChangeText/gi. test (retTxt ))
{
Return false;
} Else {
Var pattern =/<a href = \.\/\? Q = ([^ &] +) & r = ([^>] +)>/gi;
// While (result = pattern.exe c (v ))! = Null)
}
};
$ ("Temptrans"). innerHTML = shiftRelevantInterpretation (shiftHref (stripIMG (getIWanted (retTxt ))));
});
} Catch (e) {$ ("temptrans "). innerHTML = "<br> <B> Error: </B> <br> </br>" + e. description; return false ;}
}
Function rndNO (e, s)
{
Switch (e)
{
Case 0: return (d = new Date (). getYear () + (s? "-": "") + (D. getMonth () + 1) + (s? "-": "") + (D. getDate () + (s? "-": "") + (D. getHours () + (s? "-": "") + (D. getMinutes () + (s? "-": "") + (D. getSeconds () + (s? "-": "") + (D. getMilliseconds ());
Case 1: return (d = new Date (). getMonth () + 1) + (s? "-": "") + (D. getDate () + (s? "-": "") + (D. getHours () + (s? "-": "") + (D. getMinutes () + (s? "-": "") + (D. getSeconds () + (s? "-": "") + (D. getMilliseconds ());
Case 2: return (d = new Date (). getDate () + (s? "-": "") + (D. getHours () + (s? "-": "") + (D. getMinutes () + (s? "-": "") + (D. getSeconds () + (s? "-": "") + (D. getMilliseconds ());
Case 3: return (d = new Date (). getHours () + (s? "-": "") + (D. getMinutes () + (s? "-": "") + (D. getSeconds () + (s? "-": "") + (D. getMilliseconds ());
Case 4: return (d = new Date (). getMinutes () + (s? "-": "") + (D. getSeconds () + (s? "-": "") + (D. getMilliseconds ());
Case 5: return (d = new Date (). getSeconds () + (s? "-": "") + (D. getMilliseconds ());
Case 6: return (d = new Date (). getMilliseconds ());
}
}
Function stripIMG (s)
{
Var pattern =/] +>/gi;
Return s. replace (pattern ,"");
}
Function getIWanted (s)
{
If (! /DivChangeText/gi. test (s ))
{
Var pattern =/<td height = \ "320 \" width = \ "566 \"> ([\ d \ D] + )(? = Add the original statement <\/a>)/ig;
Return pattern.exe c (s) [1] + "<\/td> <\/tr> <\/table> ";
} Else {
// DivChangeText ('ssssdiv ',' <font size = "2" face = "Trebuchet MS"> 1. <a href = ./? Q = testis & r = testds> testis </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 2. <a href =. /? Q = testes & r = testds> testes </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 3. <a href =. /? Q = testas & r = testds> testas </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 4. <a href =. /? Q = tess & r = testds> tess </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 5. <a href =. /? Q = tsts & r = testds> tsts </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 6. <a href =. /? Q = test & r = testds> test </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 7. <a href =. /? Q = testy & r = testds> testy </a> </font> <br> <font size = "2" face = "Trebuchet MS"> 8. <a href =. /? Q = testa & r = testds> testa </a> </font> <br> try near-tone word query <a href = ./? Q = % 5 Btestds % 5D> [testds] </a>? ');
Var pattern =/divChangeText. */gi;
Try
{
Var bb = "sorry, this word is not found! <Br> are you looking for? <br> ";
S = s. match (pattern) [1];
S = s. match (/(<a [^>] *> .*? <\/A>)/gi );
For (var I = 0; I <s. length-1; ++ I)
{
Bb + = s [I] + "<br> ";
}
Return bb;
} Catch (e) {$ ("temptrans "). innerHTML = "<br> <B> Error: </B> <br> </br>" + e. description; return false ;}
}
}
Function shiftHref (s)
{
Var pattern =/<a href = \ "index \. php \? Q = (. + ?) (? = \ ">)/Gi;
// Var str = "synonym: <a href = \" index. php? Q = quiz \ "> quiz </a> </font> <br> 4. show a certain characteristic when tested <br> <a href = \ "index. php? Q = test \ "> test </a> <br> 5. achieve a certain score or rating on a test <br> 6. determine the presence or properties of (a substance) <br> 7. undergo a test <br> ";
Return s. replace (pattern, function () {return "<a style = 'cursor: pointer; color: blue 'onclick = \" newSearch ('"+ arguments [1]. replace (/'/g, "\'") + "')"});
}
Function newSearch (v)
{
Document. getElementsByTagName ("input") [0]. value = v;
Dict (v );
Return false;
}
Function shiftRelevantInterpretation (s)
{
Var pattern =/<a href = \.\/\? Q = ([^ &] +) & r = ([^>] +)>/gi;
Return (s. replace (pattern, function () {return "<a style = 'cursor: pointer; color: blue 'onclick = \" relevantSearch ('"+ arguments [1]. replace (/'/g, "\'") + "','" + arguments [2]. replace (/'/g, "\'") + "') \"> "}));
}
Function relevantSearch (s, r)
{
Document. getElementsByTagName ("input") [0]. value = s. replace (/\ +/gi ,"");
Dict (s, r );
Return false;
}
Ajax = function ()
{
Var navName = (function ()
{
Var u = navigator. userAgent. toLowerCase ();
If (/gecko/I. test (u) return "moz ";
If (/msie/I. test (u) return "ie ";
Return "other ";
})();
This. MODE = "GET ";
Var ie = navName = "ie ";
Var elem = $ ("_ AjaxCall_Wait ");
If (! Elem)
{
Elem = document. createElement ("div ");
Elem. id = '_ AjaxCall_Wait ';
Elem. style. position = "absolute ";
Elem. style. display = "none ";
Elem. style. background = "#3C4040 ";
Elem. style. left = "40% ";
Elem. style. top = "50% ";
Elem. style. color = "# FF6600 ";
Elem. style. padding = "7px ";
Elem. style. border = "1px solid # FF7700 ";
Document. body. insertBefore (elem, document. body. firstChild );
}
Elem. style. width = 250;
// Elem. style. height = 35;
Elem. innerHTML = "";
This. xmlHttp = function ()
{
If (ie)
{
For (var I = 0; I <2; I ++)
Try
{
Var r = new ActiveXObject (["MSXML2.XMLHTTP", "Microsoft. XMLHTTP"] [I]);
Return r;
}
Catch (e) {return null ;};
}
Else return new XMLHttpRequest ();
}
This. loadHttp = function (url, asy, fun, agv)
{
This. enabled = false;
Var xmlHttp = this. xmlHttp ();
$ ("_ AjaxCall_Wait"). style. display = "block ";
$ ("_ AjaxCall_Wait"). innerHTML = "Processing your request ...";
XmlHttp. open (this. MODE, url, (asy? True: false ));
If (asy)
{
XmlHttp. onreadystatechange = function ()
{
If (xmlHttp. readyState = 4)
{
Fun (xmlHttp );
$ ("_ AjaxCall_Wait"). innerHTML = "";
$ ("_ AjaxCall_Wait"). style. display = "none ";
}
};
This. MODE = "POST "? (XmlHttp. setRequestHeader ("Content-Type", "application/x-www-form-urlencoded"), xmlHttp. send (agv): xmlHttp. send (null );
}
Else
{
Try
{
This. MODE = "POST "? (XmlHttp. setRequestHeader ("Content-Type", "application/x-www-form-urlencoded"), xmlHttp. send (agv): xmlHttp. send (null );
}
Catch (e)
{
Throw new Error ("LoadHttp Error .");
Return;
}
Return xmlHttp. responseText;
}
}
This. Bin2Str = function (binary)
{
Try
{
Var rec = new ActiveXObject ("ADODB. RecordSet ");
Rec. Fields. Append ("lol", ,,1 );
Rec. open ();
Rec. addNew ();
Rec (0). appendChunk (binary );
Rec. update ();
Var result = rec (0). value;
Rec. Close ();
Return result;
} Catch (e ){
Var t = rsB (binary), glbEncode = new Array ();
T = escape (t ). replace (/% u/g ,""). replace (/(. {2 })(. {2})/g, "%$ 2% $1 "). replace (/% ([A-Z].) % (. {2})/g, "@ $1 $2 ");
T = t. split ("@");
Var I = 0, j = t. length, k;
While (++ I <j)
{
K = t [I]. substring (0, 4 );
If (! GlbEncode [k]) glbEncode [k] = escape (vbChar (eval ("0x" + k). substring (1, 6 );
T [I] = glbEncode [k] + t [I]. substring (4 );
}
Return unescape (t. join ("% "));
}
}
};
Var Ax = new Ajax;
Window. onload = function ()
{
Document. getElementsByTagName ("input") [0]. focus ();
}
</Script>
<Script language = vbscript>
Function rsB (vIn)
RsB = MidB (vIn, 1)
End Function
Function vbChar (ss)
VbChar = Chr (ss)
End Function
</Script>
</Body>
</Html>