assets/js/script.js
/**
 * Add a Post View When The User Viewed Post
 */
Add a Post View When The User Viewed Post
Add a Post View When The User Viewed Post
function add_view(post_id) {
  var request = new XMLHttpRequest();
  request.onreadystatechange = function () {
    if (this.readyState == 4 && this.status == 200) {
      document.querySelector('.view-modal .content .info .modal-actions .views .nth-views').innerHTML = this.responseText;
    }
  }
  request.open("POST", window.location.origin + "/laquatat/ajax_requests/post_views.php", true);
  request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
  request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  request.send('post_id=' + post_id);
}
function add_view ( post_id ) { var request = new XMLHttpRequest ( ) ; request . onreadystatechange = function ( ) { if ( this . readyState == 4 && this . status == 200 ) { document . querySelector ( '.view-modal .content .info .modal-actions .views .nth-views' ) . innerHTML = this . responseText ; } } request . open ( "POST" , window . location . origin + "/laquatat/ajax_requests/post_views.php" , true ) ; request . setRequestHeader ( 'X-Requested-With' , 'XMLHttpRequest' ) ; request . setRequestHeader ( 'Content-Type' , 'application/x-www-form-urlencoded' ) ; request . send ( 'post_id=' + post_id ) ; }
Add a Post View When The User Viewed Post
Add a Post View When The User Viewed Post
// Send a Request to add view Page
 // If The Request Has Been Sent Successfully
 // Change The Views Number in The Modal
 // Send The Request
