GWibisono

jalankan apa adanya. lalu perbaiki

Oct 14th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if(isset($_POST['url'])){
  3.   $display_data = isset( $_POST['url'] ) ? $_POST['url'] : '';
  4.   echo $display_data;
  5.   var_dump($display_data);
  6.   die(); //biar stop
  7. }
  8. ?>
  9. <!DOCTYPE html>
  10. <html lang="en">
  11. <head>
  12.   <meta charset="UTF-8">
  13.   <title>Document</title>
  14. </head>
  15. <body>
  16.   <form action="" method="post">
  17.     <input type="text" class="input-text" name="inputtxt" placeholder="Input Your Text">
  18.   </form>
  19.  
  20. <script src="jquery-1.11.1.js"></script>
  21. <!--script src="custom.js"></script-->
  22. <script>
  23. (function($) {
  24.   $('.input-text').on("blur", function () {
  25.     //get the selected value
  26.  
  27.     var selectedValue = $(this).val();
  28.         $('.fuck').text( selectedValue );
  29.         // alert($(this).val());
  30.  
  31.     //make the ajax call
  32.     $.ajax({
  33.       url: "test2a.php",
  34.       type: "POST",
  35.       data: {url : selectedValue},
  36.       success: function(){
  37.         alert('success');
  38.       },
  39.       error: function(obj, error){
  40.         alert( obj.statusText);
  41.         console.log(obj);
  42.       }
  43.     });
  44.   });
  45. })(jQuery);
  46.  
  47. </script>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment