Closed punit07 closed 7 years ago
Hi Punit, Sorry for late response...I've been focusing coding on AI and Deep Learning - thus shutting off everything else :-S
You can do something like this:
var cname = $("#name").val();
var reds = JSON.search(myjson, '//*[contains(courseName, "'+ cname +'")]');
To gain even better performance, I'd suggest that you create a snapshot of your JSON and use the snapshot when searching. Using snapshot, you'll see huge performance gain, especially if you have large JSON data.
Cheers
Hi there,
I have a form, where user enter a string/keyword to query. I want to pass this keyword to this function ... I have tried something like this ....
but its not working.
Can you please advise how do I pass a dynamic variable to the JSON.search function ?
Thanks