function init() {
  const ratingForm = document.querySelector('form[name="ratingForm"]');
  ratingForm.addEventListener('submit', e => {
    // Stops the page from refreshing on form submit
    e.preventDefault();
    // Grab the rating, comment, and content-type from the form
    const rating = ratingForm.elements.rating.value;
    const comment = ratingForm.elements.comment.value;
    const contentType = ratingForm.elements.contentType.value;
    // Sends the rating to the server and displays response
    rate(rating, comment, contentType);
  });
}
/**
 * Initializing function, the program starts here
 */
Initializing function, the program starts here
Initializing function the program starts here
function init() {
  const ratingForm = document.querySelector('form[name="ratingForm"]');
  ratingForm.addEventListener('submit', e => {
    e.preventDefault();
    const rating = ratingForm.elements.rating.value;
    const comment = ratingForm.elements.comment.value;
    const contentType = ratingForm.elements.contentType.value;
    rate(rating, comment, contentType);
  });
}
function init ( ) { const ratingForm = document . querySelector ( 'form[name="ratingForm"]' ) ; ratingForm . addEventListener ( 'submit' , e => { e . preventDefault ( ) ; const rating = ratingForm . elements . rating . value ; const comment = ratingForm . elements . comment . value ; const contentType = ratingForm . elements . contentType . value ; rate ( rating , comment , contentType ) ; } ) ; }
Initializing function, the program starts here
Initializing function the program starts here
// Stops the page from refreshing on form submit // Grab the rating, comment, and content-type from the form // Sends the rating to the server and displays response