
<title>周公解梦</title>
<style>.selected{background-color: yellow;}</style>
<meta name='viewport' content='initial-scale=1.0,maximum-scale=1.0,user-scalable=0' />
<h2 style='text-align:center; color:#CC0000;'>周公解梦</h2>
梦到: <input type="text" id="txt1" placeholder="请输入梦境" onkeyup="showHint(this.value,0)" />
<table style='width:100%;font-size:10px;'><tr><td id='td1' style='width:25%'></td><td id='td2' style='width:25%'></td><td id='td3' style='width:25%'></td><td id='td4' style='width:25%'></td></tr><tr><td id='td5' style='width:25%'></td><td id='td6' style='width:25%'></td><td id='td7' style='width:25%'></td><td id='td8' style='width:25%'></td></tr><tr><td id='td9' style='width:25%'></td><td id='td10' style='width:25%'></td><td id='td11' style='width:25%'></td><td id='td12' style='width:25%'></td></tr><tr><td id='td13' style='width:25%'></td><td id='td14' style='width:25%'></td><td id='td15' style='width:25%'></td><td id='td16' style='width:25%'></td></tr><tr><td id='td17' style='width:25%'></td><td id='td18' style='width:25%'></td><td id='td19' style='width:25%'></td><td id='td20' style='width:25%'></td></tr><tr><td id='td21' style='width:25%'></td><td id='td22' style='width:25%'></td><td id='td23' style='width:25%'></td><td id='td24' style='width:25%'></td></tr><tr><td id='td25' style='width:25%'></td><td id='td26' style='width:25%'></td><td id='td27' style='width:25%'></td><td id='td28' style='width:25%'></td></tr><tr><td id='td29' style='width:25%'></td><td id='td30' style='width:25%'></td><td id='td31' style='width:25%'></td><td id='td32' style='width:25%'></td></tr><tr><td id='td33' style='width:25%'></td><td id='td34' style='width:25%'></td><td id='td35' style='width:25%'></td><td id='td36' style='width:25%'></td></tr><tr><td id='td37' style='width:25%'></td><td id='td38' style='width:25%'></td><td id='td39' style='width:25%'></td><td id='td40' style='width:25%'></td></tr><tr><td id='td41' style='width:25%'></td><td id='td42' style='width:25%'></td><td id='td43' style='width:25%'></td><td id='td44' style='width:25%'></td></tr><tr><td id='td45' style='width:25%'></td><td id='td46' style='width:25%'></td><td id='td47' style='width:25%'></td><td id='td48' style='width:25%'></td></tr><tr><td id='td49' style='width:25%'></td><td id='td50' style='width:25%'></td><td id='td51' style='width:25%'></td><td id='td52' style='width:25%'></td></tr><tr><td id='td53' style='width:25%'></td><td id='td54' style='width:25%'></td><td id='td55' style='width:25%'></td><td id='td56' style='width:25%'></td></tr><tr><td id='td57' style='width:25%'></td><td id='td58' style='width:25%'></td><td id='td59' style='width:25%'></td><td id='td60' style='width:25%'></td></tr><tr><td id='td61' style='width:25%'></td><td id='td62' style='width:25%'></td><td id='td63' style='width:25%'></td><td id='td64' style='width:25%'></td></tr><tr><td id='td65' style='width:25%'></td><td id='td66' style='width:25%'></td><td id='td67' style='width:25%'></td><td id='td68' style='width:25%'></td></tr><tr><td id='td69' style='width:25%'></td><td id='td70' style='width:25%'></td><td id='td71' style='width:25%'></td><td id='td72' style='width:25%'></td></tr><tr><td id='td73' style='width:25%'></td><td id='td74' style='width:25%'></td><td id='td75' style='width:25%'></td><td id='td76' style='width:25%'></td></tr><tr><td id='td77' style='width:25%'></td><td id='td78' style='width:25%'></td><td id='td79' style='width:25%'></td><td id='td80' style='width:25%'></td></tr><tr><td id='td81' style='width:25%'></td><td id='td82' style='width:25%'></td><td id='td83' style='width:25%'></td><td id='td84' style='width:25%'></td></tr><tr><td id='td85' style='width:25%'></td><td id='td86' style='width:25%'></td><td id='td87' style='width:25%'></td><td id='td88' style='width:25%'></td></tr><tr><td id='td89' style='width:25%'></td><td id='td90' style='width:25%'></td><td id='td91' style='width:25%'></td><td id='td92' style='width:25%'></td></tr><tr><td id='td93' style='width:25%'></td><td id='td94' style='width:25%'></td><td id='td95' style='width:25%'></td><td id='td96' style='width:25%'></td></tr><tr><td id='td97' style='width:25%'></td><td id='td98' style='width:25%'></td><td id='td99' style='width:25%'></td><td id='td100' style='width:25%'></td></tr></table>
<div id='nr'></div>
<script>const tds=document.querySelectorAll('td');let currentIndex=-1;tds.forEach((td,index)=>{td.addEventListener('click',()=>{if(currentIndex!==-1){tds[currentIndex].classList.remove('selected');}
currentIndex=index;td.classList.add('selected');});});
function showHint(str,d)
{if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest()}else{xmlhttp=new ActiveXObject('Microsoft.XMLHTTP')}
var xmlhttp;if(d=='0'){if(str.length==0)
{for(let i=1;i<=100;i++){document.getElementById("td"+i).innerHTML='';}
document.getElementById("nr").innerHTML='';
return;}
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){for(let i=1;i<=100;i++){document.getElementById("td"+i).innerHTML='';}
document.getElementById("nr").innerHTML='';
var jsonObject=JSON.parse(xmlhttp.responseText);var ii=1;for(let i=0;i<jsonObject.length;i++){if(ii<=100){document.getElementById("td"+ii).innerHTML="<a onclick=showHint('"+jsonObject[i]+"',1)>梦到"+jsonObject[i]+"</a>";}
ii++;}}}
xmlhttp.open("GET","api.php?SYLX=zgjm&id=0&name="+str,true);}
if(d=='1'){
document.getElementById("nr").innerHTML='';
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){var jsonObject=JSON.parse(xmlhttp.responseText);htm='';for(let i=0;i<jsonObject.length;i++){htm+=jsonObject[i]+'<br>';}
document.getElementById("nr").innerHTML=htm;}}
xmlhttp.open("GET","api.php?SYLX=zgjm&id=1&name="+str,true);}
xmlhttp.send();}
</script>
<br><br><br>
<?php include 'footer.php'; ?>