From 3a6463b694b448d30dbf91d7406442129e4771dd Mon Sep 17 00:00:00 2001 From: Emond Papegaaij Date: Mon, 5 Oct 2026 14:25:28 +0200 Subject: [PATCH] Parse the pushed record of the charts example with JSON.parse The WebSocket charts example parsed every pushed message with jQuery.parseJSON. jQuery 4 removed that function, and master now uses jQuery 4 by default, so each push threw "TypeError: jQuery.parseJSON is not a function" and the chart was no longer updated. With the jQuery-free Ajax engine selected, jQuery is not loaded at all and the same line failed with a ReferenceError. JSON.parse is what jQuery.parseJSON delegated to in jQuery 3, so the example behaves as before with either jQuery version and either engine. GitHub issue #1647 Co-Authored-By: Claude Opus 5.5 --- .../java/org/apache/wicket/examples/websocket/charts/charts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/charts/charts.js b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/charts/charts.js index 501d9e0d853..12fb8d73bd0 100644 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/charts/charts.js +++ b/wicket-examples/src/main/java/org/apache/wicket/examples/websocket/charts/charts.js @@ -96,7 +96,7 @@ function drawChart() { Wicket.Event.subscribe("/websocket/message", function(jqEvent, message) { // new record is pushed by the server - var record = jQuery.parseJSON(message); + var record = JSON.parse(message); if (record && record.year) { updateChartData(record); }