大家好啊,谁可以帮我解决这个问题?
在这段代码中,如果想从数据库中动态取得数据应该如何写代码?谢谢了
城市:<input onkeyup="shortcutCode()" id='_input' name="bbb" ><br id="_select">
<input name="Button1" type="submit" value="提交"></form>
<script language="JScript">
var sds={bj:'北京',tj:'天津',sh:'上海'};
sds=new String(text0.value);
var oShortcut=sds;
alert(typeof(sds))
document.write(sds);
function shortcutCode(){
    var o=event.srcElement,v=o.value,l=v.length,t=["请选择"],s="<br id='_select'>",i;
    for(i in oShortcut)
        if(v.substr(0,l)==i.substr(0,l))
            t[t.length]=oShortcut[i];
    if(t.length==0||t.length==1)
        _select.outerHTML=s;
    else if(t.length==2)
           _input.value=t[1],_select.outerHTML=s;
        else
            _select.outerHTML="<select id='_select' onchange='_input.value=this.options[this.selectedIndex].text,this.outerHTML=\"<br id=_select>\"'><option>"+t.join('<option>')+"</select>";
    }
</script>