ajax使用get方法

发布时间:2014-02-23 23:56:31 阅读:1457次
  <script src="jquery.min.js"></script>
   
  <script>
  function get_list(str,keyword){
  //alert(str);
  //alert(keyword);
  $("#content_type").val(str);
  $.ajax({
  type: "GET",
  url:"ajaxdata.php?str="+str+"&keyword="+keyword,
  success:function(data){
  var item='';
  content=data.split("<br>");
  for(var i=0;i<content.length-1;i++){
  contentitem=content[i].split("&&");
  //alert(contentitem[0]);
  //alert(contentitem[1]);
  item+="<tr><td><input type=radio name=content_id value="+contentitem[0]+">"+contentitem[1]+"</td><td>"+contentitem[2]+"</td></tr>";
  }
  //alert(item);
  table="<table border=0 width=100%><tr><td>文字内容</td><td>日期</td></tr>"+item+"</table>";
  $("#item").html(table);
  }
  });
  }
  </script>
  <area shape="rect" coords="74,2,135,27" href="javascript:onclick=get_list('tp','');" />
  <area shape="rect" coords="146,2,209,28" href="javascript:onclick=get_list('yy','');" />
  <area shape="rect" coords="8,1,66,29" href="javascript:onclick=get_list('wenzhi','');" />
  <area shape="rect" coords="219,4,280,25" href="javascript:onclick=get_list('sp','');" />
  <area shape="rect" coords="287,2,345,24" href="javascript:onclick=get_list('url','');" />
  <area shape="rect" coords="7,34,64,59" href="javascript:onclick=get_list('tw','');" />
  <area shape="rect" coords="73,34,140,59" href="javascript:onclick=get_list('yqh','');" />
  <area shape="rect" coords="150,35,208,59" href="javascript:onclick=get_list('appointment','');" />
  <area shape="rect" coords="222,33,274,62" href="javascript:onclick=get_list('wj','');" />
  <area shape="rect" coords="286,33,346,58" href="javascript:onclick=get_list(10);" />

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
上一篇:php执行shell
下一篇:js添加append

转载请注明:ajax使用get方法 出自老鄢博客 | 欢迎分享