I have an ajax call in a php file that encodes an array into a json array / object. I am trying to print a json response in a table format or an array of DIVs. I am stuck on how to handle the response to ajax success. Here is my ajax ..
<script> $(document).ready(function(){ $("#adapter").keyup(function() { var adapter = $(this).val(); var dataString = 'searchword='+ adapter +'&format=json' ; if(adapter=='' || adapter < 2 ) { $("#display3").hide(''); } else { $.ajax({ type: "POST", url: "ajax/phpfile", data: dataString, cache: false, success: function(data) { var myObj = data; </script>
Here is the json response from the server. I can warn the whole json response, so I know that it works on the ajax side ...
{"Result":[{"ptos":{"PTOMasterID":"1","PTOMasterPart":"828B-U6805-L1CX","PTOSeriesUniqueID":"22","PTOPrice":"2715.78","PTOSeries":"82","PTOMounting":"8B","PTOTransmission":"U68","PTOSpeed":"05","PTOShifter":"L","PTOAssemblyID":"1","PTOShaftID":"C","PTOSpecialFeature":"X","PTODate":"2011-11-30 17:28:10"}},{"ptos":{"PTOMasterID":"2","PTOMasterPart":"828B-U6805-L3CX","PTOSeriesUniqueID":"22","PTOPrice":"2715.78","PTOSeries":"82","PTOMounting":"8B","PTOTransmission":"U68","PTOSpeed":"05","PTOShifter":"L","PTOAssemblyID":"3","PTOShaftID":"C","PTOSpecialFeature":"X","PTODate":"2011-11-30 17:28:10"}]}