Home HTML jQuery post() Method

jQuery post() Method

136
0

Carica i dati dal server utilizzando una richiesta HTTP POST:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $.post("demo_test_post.asp",
    {
      name: "Donald Duck",
      city: "Duckburg"
    },
    function(data,status){
      alert("Data: " + data + "\nStatus: " + status);
    });
  });
});
</script>
</head>
<body>

<button>Send an HTTP POST request to a page and get the result back</button>

</body>
</html>
Previous articleSalvataggio di un’immagine dall’URL in PHP
Next articlewith Notifications!

LEAVE A REPLY

Please enter your comment!
Please enter your name here