jQuery Documentation

Sending logs via jQuery is very easy. All you need to do is fire an Ajax request using jQuery's $.ajax() method. Consider the jQuery example below.

A response is sent back to the client from the server and once we receive the response we can do whatever we want to.



<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(document).ready(function(){

    $.ajax({
      url: 'https://logs.ws/api/1.1/',
      data: "apikey=your-api-key&format=json&type=error&log=Adding Log via jQuery",
      type: 'post',
      dataType: 'json'  ,
      success:function(data){
          if(true ===  data.result){
              alert('Log Added Successfully');
          }else{
              alert('Return Type: ' + data.result + '\nMessage: ' + data.message);
          }
    }});


});
</script>




                        



You can see a working demo here