index.js
// appends success msg to modal body
appends success msg to modal body
appends success msg to modal body
function initRemove(button, ident) {
  button.addEventListener('click', function(ev) {
    console.log('remove btn clicked');
    console.log('DELETEID:', ident)
    data = {
      eventId: ident
    }
    $.ajax({
      url: beURL + '/events/' + ident,
      data: data,
      dataType: 'json',
      method: 'DELETE'
    }).done(function(response) {
      console.log(ident, 'has been removed');
      console.log(response);
      var message = document.createElement('p');
      var pText = document.createTextNode(response);
      message.classList.add('red');
      message.classList.add('bold');
      message.appendChild(pText);
      innerContent.appendChild(message);
    })
  })
}
function initRemove ( button , ident ) { button . addEventListener ( 'click' , function ( ev ) { console . log ( 'remove btn clicked' ) ; console . log ( 'DELETEID:' , ident ) data = { eventId : ident } $ . ajax ( { url : beURL + '/events/' + ident , data : data , dataType : 'json' , method : 'DELETE' } ) . done ( function ( response ) { console . log ( ident , 'has been removed' ) ; console . log ( response ) ; var message = document . createElement ( 'p' ) ; var pText = document . createTextNode ( response ) ; message . classList . add ( 'red' ) ; message . classList . add ( 'bold' ) ; message . appendChild ( pText ) ; innerContent . appendChild ( message ) ; } ) } ) }
appends success msg to modal body
appends success msg to modal body