Pewarta Proxy

πŸ“‹ Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

βš™οΈ Pengaturan Proxy Target

Skip to main content

Name

loadJSONObject()

Description

Loads a JSON from the data folder or a URL, and returns a JSONObject.

All files loaded and saved by the Processing API use UTF-8Β encoding.

Examples

  • // The following short JSON file called "data.json" is parsed 
    // in the code below. It must be in the project's "data" folder.
    
    /*  
      {
        "id": 0,
        "species": "Panthera leo",
       "name": "Lion"
      }
    */
    
    JSONObject json;
    
    void setup() {
    
      json = loadJSONObject("data.json");
    
      int id = json.getInt("id");
      String species = json.getString("species");
      String name = json.getString("name");
    
      println(id + ", " + species + ", " + name);
    }
    
    // Sketch prints:
    // 0, Panthera leo, Lion
    

Syntax

  • loadJSONObject(filename)

Parameters

  • filename(String)name of a file in the data folder or aΒ URL

Return

  • JSONObject