Skip to content

Parse the pushed record of the charts example with JSON.parse - #1649

Merged
papegaaij merged 1 commit into
masterfrom
charts-example-json-parse
Oct 5, 2026
Merged

papegaaij merged 1 commit into
masterfrom
charts-example-json-parse

Conversation

@papegaaij

Copy link
Copy Markdown
Contributor

Fixes #1647.

The WebSocket charts example parsed every pushed message with jQuery.parseJSON, which jQuery 4 removed. Master now defaults to jQuery 4, so every push threw TypeError: jQuery.parseJSON is not a function and the chart stopped updating. With the jQuery-free engine selected, jQuery isn't loaded at all. This PR uses JSON.parse instead, which works with either jQuery version and either engine.

Checked in headless Chrome by loading the real charts.js with jQuery 4, the default engine and a stubbed Google Charts loader, then publishing a /websocket/message. Master's version throws; the fixed one draws the pushed record. I did not run the example itself in Jetty. mvn clean verify -Pjs-test is green.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@papegaaij papegaaij added the javascript Pull requests that update Javascript code label Oct 5, 2026

@dashorst dashorst left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems harmless enough.

@papegaaij
papegaaij merged commit f3d5c10 into master Oct 5, 2026
3 checks passed
@papegaaij
papegaaij deleted the charts-example-json-parse branch October 5, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The WebSocket charts example calls jQuery.parseJSON, which jQuery 4 removed

3 participants