Issue retrieving JSON results from php
Hi guys hoping someone can help me here,
When running the following query I'm receiving the JS error
Uncaught TypeError: Cannot read property 'ID' of null.
- $.getJSON(
- 'query/query.php',
- { 'task':'course_view' },
- function( data )
- {
- alert("Data Loaded: " + data.ID);
- }
- );
However when I replace the $.getJSON( with $('#content').load( I quite happily see the following JSON formatted data on my page:
{"ID":"1","Name":"Test","NumberOfYears":"6"}
Any ideas why getJSON doesn't appear to be picking this up?
Many thanks