Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
demos: Replace search.php with $.ajaxTransport() mock
  • Loading branch information
Krinkle authored Jan 3, 2024
commit 604aae1a5739f4b1980959ceed024e44619f6c7e
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
Loading