62,255
社区成员
发帖
与我相关
我的任务
分享var kw=$("#kw").val();
var url = "Suggest.aspx?kw=" + kw + "&callback=?";
$.getJSON(url,function(data){
if (data!='') {
} string htmlstr = "";
htmlstr += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
htmlstr += "<li class='sokeyup_2' id='l_" + i + "'>" + kword + "</li>";
Response.ContentType = "text/xml";
Response.Write("" + htmlstr + "");
Response.End();
string Key = Request["kw"];
sql语句...
string htmlstr = "";
// htmlstr += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
while (sdr.Read())
{
string kword = sdr["keyword"].ToString();
string a = sdr["num"].ToString();
int i = 1;
htmlstr += "<ul class='sokeyup_1' onmouseover='keyup_over(" + i + ")' onmouseout='keyup_out(" + i + ")' onclick='keyup_click(" + i + ")' id='u_" + i + "'>";
htmlstr += "<li class='sokeyup_3'>" + a + " 结果</li></ul>";
i++;
}
//Response.Clear();
// Response.ContentType = "text/xml";
// Response.Charset = "gb2312" ;
// Response.Write("" + htmlstr + "");
Response.Write("({(\""+ htmlstr +"\")})"); //试了很多种
Response.End();
sdr.Close();
con.Close();
}
var kw=$("#kw").val();
//var url = "Suggest.aspx?kw=" + kw + "&callback=?";
var url = "Suggest.aspx?kw=" + kw + "&callback=?&rad=" + Math.random();
$.getJSON(url, function(data) {
if (data != '') {
alert(data);
$("#keyup_d").html(data + '<ul class="sokeyup_4"><li id="l_0" >ok</li></ul>');
}
);protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/plain";
//不让浏览器缓存
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.AddHeader("pragma", "no-cache");
Response.AddHeader("cache-control", "");
Response.CacheControl = "no-cache";
string htmlstr = "";
htmlstr += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
htmlstr += "<li class='sokeyup_2' id='l_" + i + "'>" + kword + "</li>";
Response.ContentType = "text/xml";
Response.Write("" + htmlstr + "");
Response.End();
return;
}