First post, new to this stuff, having a newb issue:
I have the following code, which is successfully pulling back the JSON object with the data fields / rows from mysql.
*****Begin Code*****
$(document).ready(function(){
$(document).bind('deviceready', function(){
var output3 = $('#blog1');
$.ajax({
type: 'GET',
url: 'http://xxxxx.com/aaa/blog.php',
dataType: 'jsonp',
jsonp: 'jsoncallback',
timeout: 5000,
success: function(data, status){
$.each(data, function(i,item){
var blog1 = '<b>Published:</b> '+item.date+' <br>'
+ '<b>Title: </B>' +item.title+ '<br>'
+ '<b>Summary: </B>' +item.summary+'<br>'
+ '<b>Post: </b>' +item.blog_text+'<br>';
output3.append(blog1);}
);
},
error: function(){
output.text('We are sorry, the TPro blog can not be loaded at this time. Please check your network connection.');
}
});
});
});
****END CODE****
What I can not figure out is how to pull out a field (or multiple fields) within each JSON record, and then drop that return value (such as blog1 above) into a collapsible panel div in query mobile (building within phone gap).
The end goal is to return the five most recent rows from mysql into 5 collapsible panels in the DOM. I am new to this (obviously) and learning by doing from all of you experts. Thank you for the help!
Craig