View difference between Paste ID: 8tB7J7DF and bT4Yr0W7
SHOW: | | - or go back to the newest paste.
1-
<!-- ======================= custom.js==================== -->
1+
<?php
2
if(isset($_POST['url'])){
3
  $display_data = isset( $_POST['url'] ) ? $_POST['url'] : '';
4-
  $('.input-text').on("change", function () {
4+
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-
      url: "testos.php", 
13+
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-
      error: function(){
19+
 
20-
        alert('error !');
20+
21
<!--script src="custom.js"></script-->
22
<script>
23
(function($) {
24
  $('.input-text').on("blur", function () {
25
    //get the selected value
26-
<!-- ======================= testos.php ==================== -->
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-
<body>
34+
35
      data: {url : selectedValue},
36-
  <?php
36+
37
        alert('success');
38
      },
39
      error: function(obj, error){
40-
  ?>
40+
        alert( obj.statusText);
41
		console.log(obj);
42
      }
43
    });
44
  });
45-
  
45+
46
47-
<script src="custom.js"></script>
47+
</script>
48
</body>
49
</html>