Jump to content
Larry Ullman's Book Forums

cnusinov

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by cnusinov

  1. Ok, still having some issues (just sitting down again to work on this). 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).

     

    I know this is not a JavaScript question per se, but I hope someone can help! Is this type of script sampling in Larry's AJAX book?

     

    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!

  2. Hello Everyone -

     

    Anyone have a good tutorial / sample of the following type of functionality:

     

    I can load data from a MySQL query into a JSON object via an AJAX call. What I can not figure out is how to then move each data field into a separate variable within HTML5's local storage, so that I can use it for a quiz type application.

     

    I am using PhoneGap to deploy this type of application.

     

    Any pointers or links would be phenomenal and I thank you for your help.

     

    Craig

  3. Larry,

     

    Really informative book and helping me get some of my chops back from years ago. Quick question for you: on the PeachPit site where I registered my e-book purchase, you had an article entitled 'A Complete(-ish) Login System Using jQuery'. Are those files available for download somewhere? Maybe I've stared at the monitor a bit too long this weekend, but I can't seem to find a link for the files you reference in the article. Many thanks in advance, and again, awesome book.

     

    Thank you,

     

     

    Craig

×
×
  • Create New...