Skip to content

Commit

Permalink
chore: disable jsonp crossorigin option
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 13, 2024
1 parent 1e536bb commit 6b1146f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/demo/src/examples/slickgrid/example3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export class Example3 {
// this.http.get(`http://gd.geobytes.com/AutoCompleteCity?q=${searchText}`).subscribe(data => updateCallback(data));

/** with JSONP AJAX will work locally but not on the GitHub demo because of CORS */
fetchJsonp<string[]>(`http://gd.geobytes.com/AutoCompleteCity?q=${searchText}`, { crossorigin: true })
fetchJsonp<string[]>(`http://gd.geobytes.com/AutoCompleteCity?q=${searchText}`)
.then((response: { json: () => Promise<any[]> }) => response.json())
.then((json: any[]) => updateCallback(json))
.catch((ex) => console.log('invalid JSONP response', ex));
Expand All @@ -298,7 +298,7 @@ export class Example3 {
filterOptions: {
minLength: 3,
fetch: (searchText: string, updateCallback: (items: false | any[]) => void) => {
fetchJsonp<string[]>(`http://gd.geobytes.com/AutoCompleteCity?q=${searchText}`, { crossorigin: true })
fetchJsonp<string[]>(`http://gd.geobytes.com/AutoCompleteCity?q=${searchText}`)
.then((response: { json: () => Promise<any[]> }) => response.json())
.then((json: any[]) => updateCallback(json))
.catch((ex: any) => console.log('invalid JSONP response', ex));
Expand Down

0 comments on commit 6b1146f

Please sign in to comment.