Issue In Parsing Simple JSON Array

I've been trying to figure this out for what seems like forever. My PHP is working fine. As an example, it returns the following if I select "Grove Bow" from my select dropdown:\[code\][{"wtype":"Grove Bow","was":"1.55","wcc":"5","wbdmin":"12","wbdmax":"37"}]\[/code\]The issue is in parsing the data in the success callback function in my .js file where I have written:\[code\]$.post("get.php", {w:wname}, function(data) { was = data[1].was; wcc = data[2].wcc; wbdmin = data[3].wbdmin; wbdmax = data[4].wbdmax; console.log($.parseJSON(data)); });\[/code\]The console returns what I believe to be an empty array:\[code\][Object]0: Objectlength: 1__proto__: Array[0]\[/code\]If I remove the $.parseJSON() the console returns the same result that was posted by my get.php file:\[code\][{"wtype":"Grove Bow","was":"1.55","wcc":"5","wbdmin":"12","wbdmax":"37"}]\[/code\]I need to access these elements of the array as you can see by my attempt to store them as variables (don't worry, I declared them earlier at the top of my .js file).Pliss halp!
 
Back
Top