<script>
function show(data){
var oUl=document.getElementById('ul1');
var arr=data.s;
oUl.innerHTML=' ';
for(vari=0;i<arr.length;i++){
var oLi=document.createElement('li');
oLi.innerHTML=arr[i];
oUl.appendChild(oLi);
}
}
window.onload=function(){
var oT=document.getElementById('t1');
oT.oninput=function(){
var str=oT.value;
var oScript=document.createElement('script');
document.head.appendChild(oScript);
//这里 要是src只是相当于引了一个js文件
oScript.src='https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su? wd='+str+'&cb=show';
}
};
</script>
<body>
<input type=" text" name=" " id=''t1"/>
<ul id='"ul1 ">
</ul>
</body>
网友评论