This is an automated email from the ASF dual-hosted git repository.

papegaaij pushed a commit to branch charts-example-json-parse
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 3a6463b694b448d30dbf91d7406442129e4771dd
Author: Emond Papegaaij <[email protected]>
AuthorDate: Mon Oct 5 14:25:28 2026 +0200

    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 <[email protected]>
---
 .../src/main/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 501d9e0d85..12fb8d73bd 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);
                }

Reply via email to