Ajax Online Dictionary

Source: Internet
Author: User
Tags getdate

<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.previousSibling.previousSibling.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 : 650px;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). responsebody)));
if (!/dictadd/gi.test (rettxt))
{
$ ("Temptrans"). InnerHTML = "Sorry, this word is not found!";
Divchangetext (' Progressdiv ', ' <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><br> try to look up the word <a href=./? q=%5bcompaign%5d>[compaign]</a>? ');
if (!/divchangetext/gi.test (rettxt))
{
return false;
}else{
var pattern =/<a href=\.\/\?q= ([^&]+) &r= ([^>]+) >/gi;
while (result = Pattern.exec (v))!= null)
}
};
$ ("Temptrans"). InnerHTML = Shiftrelevantinterpretation (Shifthref (stripimg (getiwanted)));
});
}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 new words this <\/a>)/ig;
return Pattern.exec (s) [1] + "<\/td><\/tr><\/table>";
}else{
  //divchangetext (' Progressdiv ', ' <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><br> try to find the word <a href=./?q=%5btestds%5d>[testds]</a>
var pattern =/divchangetext.*/gi;
Try
{
var bb = "Sorry, this word did not find!<br> you are looking for is not:<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><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><br>6. Determine the presence or properties of (a substance) <br><br>7. undergo a test<br><br><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 to "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 to 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", 201, 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&LT;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>

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.