Advertisement
Latkoski

Untitled

Dec 22nd, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Title</title>
  6.  
  7.     <link rel="stylesheet" href="jquery-ui.css"/>
  8.     <script src="jquery.js"></script>
  9.     <script src="jquery-ui.js"></script>
  10.  
  11.  
  12.  
  13.     <script>
  14.  
  15.  
  16.         $(document).ready(function(){
  17.  
  18.             $("#tabela").show();
  19.  
  20.             $("#kopche").click(function(){
  21.  
  22.                 $.ajax({
  23.                     url:"123.xml",
  24.                     dataType: "xml",
  25.                     success: function(data){
  26.                         $(data).find("CD").each(function(){
  27.                             var title = $(this).find("TITLE").text();
  28.                             var artist = $(this).find("ARTIST").text();
  29.                             var country = $(this).find("COUNTRY").text();
  30.                             var company = $(this).find("COMPANY").text();
  31.                             var price = $(this).find("PRICE").text();
  32.                             var year = $(this).find("YEAR").text();
  33.                             $("#tabela").append("<tr>" + "<td class='title'>" + title +"</td>" + "<td class='artist'>" + artist +
  34.                                     "</td>" + "<td class='country'>" + country
  35.                                     +"</td>"+ "<td class='company'>" + company +
  36.                                     "</td>"+ "<td class='price'>" + price +"</td>"
  37.                                     + "<td class='year'>" + year +"</td>" + "</tr>");
  38.  
  39.                         })
  40.                     }
  41.                 });
  42.  
  43.             })
  44.  
  45.         });
  46.     </script>
  47.  
  48.     </head>
  49.     <style>
  50.  
  51.  
  52.         #kopche:hover{
  53.             border: 1px solid red;
  54.         }
  55.         table td{
  56.             border: 2px solid black;
  57.         }
  58.         table{
  59.  
  60.             border: 2px solid black;
  61.         }
  62.         .hide{
  63.             display:none;
  64.         }
  65.     </style>
  66.  
  67. <body>
  68. <div>
  69.     <button id="kopche">Get Data</button>
  70.     <br>
  71.     <select id="selekt">
  72.         <option value="TITLE">TITLE</option>
  73.         <option value="ARTIST">ARTIST</option>
  74.         <option value="COUNTRY">COUNTRY</option>
  75.         <option value="COMPANY">COMPANY</option>
  76.         <option value="PRICE">PRICE</option>
  77.         <option value="YEAR">YEAR</option>
  78.     </select>
  79.     <input type="checkbox" id="check">
  80.     <table id="tabela">
  81.         <tr>
  82.             <td style="font-weight: bold" class="title">TITLE:</td>
  83.             <td style="font-weight: bold" class="artist">ARTIST:</td>
  84.             <td style="font-weight: bold" class="country">COUNTRY:</td>
  85.             <td style="font-weight: bold" class="company">COMPANY:</td>
  86.             <td style="font-weight: bold" class="price">PRICE:</td>
  87.             <td style="font-weight: bold" class="year">YEAR:</td>
  88.         </tr>
  89.     </table>
  90. </div>
  91. </body>
  92. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement