Skip to content

Commit 96f8e0b

Browse files
vishrclaude
andcommitted
docs(jsonp): modernize jQuery calls in example
Replace deprecated jQuery APIs in the JSONP client demo: - $(document).ready(fn) -> $(fn) - .click(fn) -> .on("click", fn) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b28a87c commit 96f8e0b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

site/src/content/docs/cookbook/jsonp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ func main() {
6666
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
6767
<script type="text/javascript">
6868
var host_prefix = 'http://localhost:1323';
69-
$(document).ready(function() {
69+
$(function() {
7070
// JSONP version - add 'callback=?' to the URL - fetch the JSONP response to the request
71-
$("#jsonp-button").click(function(e) {
71+
$("#jsonp-button").on("click", function(e) {
7272
e.preventDefault();
7373
// The only difference on the client end is the addition of 'callback=?' to the URL
7474
var url = host_prefix + '/jsonp?callback=?';

0 commit comments

Comments
 (0)