Read array of local storage and parse it to use it in DB query where clause


I have the below JS for a DB service where clause

return '{"Type":"' + localStorage.getItem("lclStg_par1") + '"}';

where lclStg_par1 is a local storage parameter, where I store an array of dynamically created check boxes.
If I have one value in lclStg_par1, like Food, all works fine.
If in the lclStg_par1, I have Food,Drink, query where does not work.

I would like to have a code to parse the lclStg_par1 array and construct the proper where clause, so I can return all records from DB that contains Food and Drink.

Thanks a lot.!
2 people have
this question
This topic is no longer open for comments or replies.