Advertisement
nalyk

propune.php

Mar 30th, 2011
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.99 KB | None | 0 0
  1.  <script type="text/javascript">
  2.  
  3.     $(document).ready(function() {
  4.  
  5.             var dataString = 'do=refresh';
  6.             var test = $("#content").val();
  7.        
  8.             $("#flash").show();
  9.             $("#flash").fadeIn(400).html('<img src="loading.gif" align="absmiddle">&nbsp;<span class="loading">Afișez piesele...</span>');
  10.    
  11.             $.ajax({
  12.                 type: "POST",
  13.                 url: "propuneri.php",
  14.                 data: "do=refresh",
  15.                 cache: false,
  16.                 success: function(html){
  17.                         $('#display').empty();
  18.                         $("#display").replaceWith(html);
  19.                         document.getElementById('content').value='';
  20.                         $("#flash").hide();
  21.                 }
  22.             });
  23.     });
  24.  
  25. $(function() {
  26.     $(".comment_button").click(function() {
  27.  
  28.         var element = $(this);
  29.    
  30.         var test = $("#content").val();
  31.    
  32.         var dataString = 'do=update&uid=<?php echo $uid; ?>&content='+ test;
  33.    
  34.    
  35.    
  36.         if(test=='')
  37.         {
  38.             alert("Please Enter Some Text");
  39.         }
  40.         else
  41.         {
  42.             $("#flash").show();
  43.             $("#flash").fadeIn(400).html('<img src="loading.gif" align="absmiddle">&nbsp;<span class="loading">Adaug piesa...</span>');
  44.    
  45.             $.ajax({
  46.                 type: "POST",
  47.                 url: "propuneri.php",
  48.                 data: dataString,
  49.                 cache: false,
  50.                 success: function(html){
  51.                         $("#display").after(html);
  52.                         document.getElementById('content').value='';
  53.                         $("#flash").hide();
  54.                 }
  55.             });
  56.         }
  57.         return false;
  58.     });
  59.  
  60.     $(".refresh").click(function() {
  61.  
  62.     var dataString = 'do=refresh';
  63.     var test = $("#content").val();
  64.    
  65.         $("#flash").show();
  66.             $("#flash").fadeIn(400).html('<img src="loading.gif" align="absmiddle">&nbsp;<span class="loading">Actualizez lista...</span>');
  67.    
  68.             $.ajax({
  69.                 type: "POST",
  70.                 url: "propuneri.php",
  71.                 data: dataString,
  72.                 cache: false,
  73.                 success: function(html){
  74.                     $('#display').empty();
  75.                     $("#display").replaceWith(html);
  76.                     document.getElementById('content').value='';
  77.                     $("#flash").hide();
  78.                 }
  79.             });
  80.         return false;
  81.     });
  82. });
  83. </script>
  84. <div align="center">
  85.     <table cellpadding="0" cellspacing="0" width="500px">
  86.         <tr>
  87.             <td>
  88.                 <div align="left">
  89.                     <form  method="post" name="form" action="">
  90.                         <table cellpadding="0" cellspacing="0" width="500px">
  91.                             <tr>
  92.                                 <td align="left"><div align="left" style="floating: left;"><h3>Ce piesă propui?</h3></div></td>
  93.                             </tr>
  94.                             <tr>
  95.                                 <td style="padding:4px; padding-left:10px;" class="comment_box">
  96.                                     <textarea cols="30" rows="2" style="width:480px;font-size:14px; font-weight:bold" name="content" id="content" maxlength="145" ></textarea><br />
  97.                                     <div style="float: right;"><INPUT TYPE="image" SRC="refresh.png" BORDER="0" ALT="Refresh" class="refresh"></div>
  98.                                     <div style="float: left;"><input type="submit"  value="Propune"  id="v" name="submit" class="comment_button"/></div>
  99.                                     <div style="clear: both;"></div>
  100.                                 </td>
  101.                             </tr>
  102.                         </table>
  103.                     </form>
  104.                 </div>
  105.                 <div style="height:7px"></div>
  106.                 <div id="flash" align="left"  ></div>
  107.                 <div id="display" align="left"></div>
  108.             </td>
  109.         </tr>
  110.     </table>
  111. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement