您好我在VS 2012中使用HTML5和Javascript开发一个windows8应用程序。
我要求提供搜索功能,就像当用户搜索搜索栏中的任何内容时,数据应该显示在搜索自动完成中。数据以JSON格式提供,点击此URL“http://healthkartplus.com/webservices/search/both?name=crocin”并获得结果。如果有人意识到,请帮助我。
以下是我在搜索栏中搜索crocin时的结果。我想要来自这个JSON的结果数据。
{"status":0,"errors":null,"op":"searching","result":[{"id":26725,"mfId":55078,"label":"Crocin (1000 mg) 40 Tablet(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin (1000 mg)","type":"drugs","packSize":"40 Tablet","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":27050,"mfId":55078,"label":"Crocin (15 ml) 15 ml(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin (15 ml)","type":"drugs","packSize":"15 ml","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":26696,"mfId":55078,"label":"Crocin (500 mg) 15 Tablet(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin (500 mg)","type":"drugs","packSize":"15 Tablet","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":27014,"mfId":55078,"label":"Crocin (60 ml) 60 ml(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin (60 ml)","type":"drugs","packSize":"60 ml","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":26780,"mfId":55078,"label":"Crocin (650 mg) 10 Tablet(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin (650 mg)","type":"drugs","packSize":"10 Tablet","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":26933,"mfId":55078,"label":"Crocin DS (60 ml) 60 ml(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin DS (60 ml)","type":"drugs","packSize":"60 ml","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":27035,"mfId":55078,"label":"Crocin Paed (15 ml) 15 ml(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin Paed (15 ml)","type":"drugs","packSize":"15 ml","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":64010,"mfId":55078,"label":"Crocin Pain Relief Tab 10 x 1(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin Pain Relief Tab ","type":"drugs","packSize":"10 x 1","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."},{"id":26733,"mfId":55078,"label":"Crocin Quik (500 mg) 10 Tablet(Glaxo Smithkline Pharmaceuticals Ltd.)","name":"Crocin Quik (500 mg)","type":"drugs","packSize":"10 Tablet","manufacturer":"Glaxo Smithkline Pharmaceuticals Ltd."}],"hasMore":false,"suggestions":[]}
答案 0 :(得分:1)
搜索合约示例应用程序显示了如何执行此操作。