Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

16.9. Parsing JSON

16.9.1. Problem

You’re passed a string of JSON data and need to convert it to object format.

16.9.2. Solution

(function($) {
    $(document).ready(function() {
        var serializedJSON = '{"title":"Hello World!","body":"It\'s great to be 
alive!"}';
        var message = JSON.parse( serializedJSON );
    });
})(jQuery);

					  


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial