Parse JSON using .parseJSON()

.parseJSON()


Description: Parse a JSON string into an object.


Example:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>parseJSON demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
    </head>
    <body>
      
      <div class="framework"></div><br />
      <div class="methodname"></div><br />
      
      <script>
         
        bitsyCode.ready(function(){
            
            var jsonCollection = bitsyCode.parseJSON('{"framework":"BitsyCode","methodName":"parseJSON"}');
            bitsyCode(".framework").text(jsonCollection.framework);
            bitsyCode(".methodname").text(jsonCollection.methodName);
            
        })
         
      </script>
     
    </body>
    </html>

Preview:

BitsyCode

parseJSON

  • Usage

    • How to use:

      Parse a JSON string into an object.

    • USAGE:

      bitsyCode.parseJSON('{"parse":"JSON String"}');
  • Options

    • What options are there:

      There are no options for this method.

  • Returns

    • Returns: object{} //Returns the parsed JSON string into an object.
Share