zoukankan      html  css  js  c++  java
  • AJAX-点击显示 出现表单内容

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="../jquery-1.11.2.min.js"></script>
    <title>无标题文档</title>
    </head>
    
    <body>
    <input  type="button" value="显示" id="btn"/>
    <table  width="100%" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <td>代号</td>
        <td>名称</td>
        <td>操作</td>
      </tr>
      <tbody id="tb">
      </tbody>
    </table>
    <script type="text/javascript">
    $("#btn").click(function(){
        var bbb=$("#tb").html();
         $.ajax({
                         url:"nationchuli.php",
                         dataType:"TEXT",
                         success: function(data){
                         var hang = data.split("|");
                        
                             var str="";
                             for(var i=0;i<hang.length;i++)
                             { 
                                 var lie =hang[i].split("^");
                                 str=str+"<tr><td>"+lie[0]+"</td><td>"+lie[1]+"</td></tr>";
                             }
                        
                                $("#tb").html(str);
                         }
                   })
                   
        })
                     
    
    </script>
    </body>
    </html>
    <?php
    include("../DBDA.class.php");
    $db = new DBDA();
    $sql="select * from nation";
    echo $db->StrQuery($sql);
  • 相关阅读:
    Python爱心动画GIF
    R学习-8.Logic
    R学习-7.Matrices and Data Frames
    R学习-6.Subsetting Vectors
    R学习-5.Missing Values
    R学习-4.Vectors
    R学习-3.sequence of numbers
    R学习-2.Workspace and Files
    R学习-1.Basic Building Blocks
    通过生物学数据预测年龄-1
  • 原文地址:https://www.cnblogs.com/benpaodegegen/p/6053290.html
Copyright © 2011-2022 走看看