Skip to content

Commit

Permalink
demos: Replace search.php with $.ajaxTransport() mock
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Jan 3, 2024
1 parent 2de8604 commit 604aae1
Show file tree
Hide file tree
Showing 9 changed files with 645 additions and 611 deletions.
3 changes: 2 additions & 1 deletion demos/autocomplete/multiple-remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
})
.autocomplete({
source: function( request, response ) {
$.getJSON( "search.php", {
$.getJSON( "search.json", {
term: extractLast( request.term )
}, response );
},
Expand Down Expand Up @@ -58,6 +58,7 @@
}
});
</script>
<script src="../search.js"></script>
</head>
<body>

Expand Down
3 changes: 2 additions & 1 deletion demos/autocomplete/remote-jsonp.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$( "#birds" ).autocomplete({
source: function( request, response ) {
$.ajax( {
url: "search.php",
url: "search.json",
dataType: "jsonp",
data: {
term: request.term
Expand All @@ -37,6 +37,7 @@
}
} );
</script>
<script src="../search.js"></script>
</head>
<body>

Expand Down
3 changes: 2 additions & 1 deletion demos/autocomplete/remote-with-cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
return;
}

$.getJSON( "search.php", request, function( data, status, xhr ) {
$.getJSON( "search.json", request, function( data, status, xhr ) {
cache[ term ] = data;
response( data );
});
}
});
</script>
<script src="../search.js"></script>
</head>
<body>

Expand Down
3 changes: 2 additions & 1 deletion demos/autocomplete/remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
}

$( "#birds" ).autocomplete({
source: "search.php",
source: "search.json",
minLength: 2,
select: function( event, ui ) {
log( "Selected: " + ui.item.value + " aka " + ui.item.id );
}
});
</script>
<script src="../search.js"></script>
</head>
<body>

Expand Down

0 comments on commit 604aae1

Please sign in to comment.