I'm having problems adding a XHR request to query JSON to my script, I rarely work with either so it's giving me a lot of problems. I know that I will need to query a JS file, and that I will need to select from matches in an array, but I am completely stumped on how to do it. Something else I need to do is count matches each time I fire of a request.
The categories startList is what I am using now, it's not really filled in but I was just trying to get it to work first before I started using JSON. Can anyone help me here?
var categories = []; categories["startList"] = ["Men","Women"] categories["Men"] = ["Red","Blue","Multi"]; categories["Red"] = ["Leather","Metal","Ceramic","Plastic"]; categories["Leather"] = ["",""]; categories["Metal"] = ["",""]; categories["Ceramic"] = ["",""]; categories["Plastic"] = ["",""]; categories["Blue"] = ["This","That","Neither"]; categories["Multi"] = ["One","Two","Other"]; categories["Women"] = ["Green","Hot Pink","Multi"]; categories["Green"] = ["Them","Those","Moo"]; categories["Hot Pink"] = ["The","Quick","Brown"]; categories["Multi"] = ["Three","Four","Other"]; var nLists = 6; function fillSelect(currCat,currList){ var step = Number(currList.name.replace(/\D/g,"")); for (i=step; iHere is a quick sample of one of the JSON fields I will want to query.
{ "idName": "The Time Teller", "forGender": "m", "caseDiameter": 1.5, "caseThickness": 0.5, "bandWidth": 0.78, "itemWeight": 1.44,{ "sku": 155320,{ "color1": "white", "color2": "none", "price": 59.99, "cat": "29400", "img": "155320-0002-front", "sku": 155411,{ "color1": "blue", "color2": "none", "price": 59.99, "cat": "32579", "img": "155411-0005-front", "sku": 160041,{ "color1": "black", "color2": "pink", "price": 59.99, "cat": "38404", "img": "160041-0001-front", }, "specialInformation": [ { "restrictions": "Available for US customers only." "detail": "Custom 3 hand Japanese quartz movement.", "detail": "100 meter molded polycarbonate case.", "detail": "Hardened mineral crystal.", "detail": "Locking looper and polycarbonate buckle.", }, { "desc": "Nixon's The Time Teller watch keeps it simpleton with hard case and custom molded polyurethane band."' } ] }