Synchronous XMLHttpRequest on the main thread is deprecated error at the end of ajax call
I at least found a solution. What I did was add the below again to my webform's tpl file, because that was the one which had stopped working.

$(".messages").on("click", function() {
  $(this).hide();
});