From 2488a84233c6636aa0cd303dd3e4e5b062755c90 Mon Sep 17 00:00:00 2001 From: Finn Bacall Date: Wed, 20 May 2026 12:49:36 +0100 Subject: [PATCH 1/2] Fix AJAX error caused by old version of JQuery being loaded Fix JS eval error when loading calendar --- app/assets/javascripts/application.js | 5 ++--- app/views/events/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index baebffef4..28b2b1b5a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,7 +10,7 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // -//= require jquery +//= require jquery3 //= require jquery.turbolinks //= require jquery_ujs //= require bootstrap-sprockets @@ -79,8 +79,7 @@ const Index = { // Perform an ajax request to load the calendar and replace the contents window.loadCalendar = function(url) { - req = $.ajax(url); - req.done((res) => eval(res)); + $.ajax(url, { dataType: 'script', cache: true }); // Is loaded automatically. return true; } diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 36f517ca0..cab70d890 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -26,7 +26,7 @@