I have a searchbox that is working with a local Json data (in the same file) using a var but now I would like to use with an external url json file in the same way that it works before.
What I have now:
var data1 = [{"test_id":"1","test":"test","test2":"test2"}];
What I'm trying:
var data = $.ajax({
dataType: "json",
url: 'myjsonurl',
data: data
});
I've tried with getJSON and with other some recommendations but are not working as I expect, in the image you can see that I'm having the data in both ways but quite different and is not working in the searchbox.
Image: https://i.stack.imgur.com/kWKkz.png
You can find the searchbox here:
https://www.js-tutorials.com/javascript-tutorial/live-search-json-objects-data-using-jquery/
Is there any idea to get same data as I have now from an external file and use it into a var as the searchbox do?
Any ideas?
Thanks in advance,