- 后台函数
- public void googleSearch()
- {
- string con=Request.QueryString["content"].ToString();
- StringBuilder st=new StringBuilder();
- string sqlTxt="select top 10 title from dbo.googleSearch where title like /'"+con+"%'";
- SqlDataReader dr=SqlHelper.ExecuteReader(SqlHelper.dsn,CommandType.Text,sqlTxt);
- while(dr.Read())
- {
- string str="<li οnclick='javascript:click_li(this)' οnmοuseοver=/"mouseover(this)/">--"+dr["title"].ToString()+"--</li>";
- st.Append(str);
- }
- cityName=st.ToString().Trim();
- Response.Write(cityName);
- Response.End();
- }
- 前台(关键)函数
- $("#search").keyup(function(){
- var con=$(this).val();
- $("#ulCon").load("post_test.aspx?content="+con+"&flag=2",function(responseText)
- {
- if(responseText=="")
- {
- $("#fitContent").css("display","none");
- }
- else
- {
- $("#fitContent").css("display","block");
- }
- });