p5.js getURLParams() Function Last Updated : 10 Aug, 2023 Comments Improve Suggest changes Like Article Like Report The getURLParams() function is used to return the current URL parameters a JavaScript object, with each parameter as a separate member of the object. Syntax: getURLParams() Parameters: This function does not accept any parameters. Return Value: It returns an Object of the path parameters. Below example illustrates the getURLParams() function in p5.js: Example: JavaScript function setup() { createCanvas(500, 200); // get the url path as array urlParamsObject = getURLParams(); textSize(16); text("The URL is: http://example.com?height=100&width=500&type=box", 10, 20); text("The URL parameters are: ", 10, 60); text("Type parameter: " + urlParamsObject["type"], 10, 80); text("Height parameter: " + urlParamsObject.height, 10, 100); text("Width parameter: " + urlParamsObject.width, 10, 120); // display the array in the console console.log(urlParamsObject); } Output: Displaying the properties of the object: Viewing the object in the console: Online editor: https://editor.p5js.org/ Environment Setup: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/ Reference: https://p5js.org/reference/#/p5/getURLParams Comment More infoAdvertise with us Next Article p5.js getURLParams() Function S sayantanm19 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-p5.js Similar Reads p5.js getURLPath() Function The getURLPath() function is used to return the current URL path as an array, with each item being a portion of the URL path. This array can be traversed to access every portion of the path separately. Syntax: getURLPath() Parameters: This function does not accept any parameters. Return Value: It re 1 min read p5.js getURL() Function The getURL() function in p5.js is used to return the current URL. Syntax: getURL() Parameters: This function does not accept any parameter. Return Value: It returns the current URL string. Below program illustrates the getURL() function in p5.js: Example: javascript // Declare a URL variable let url 1 min read p5.js httpGet() Function The httpGet() function in p5.js is used to execute an HTTP GET request. The datatype returned is automatically guessed by p5 based on the URL, when it is not specified.The data could be loaded in the preload() function so that it can be accessed immediately in the program.Syntax:Â httpGet( path, [da 3 min read p5.js httpDo() Function The httpDo() function in p5.js is used to execute an HTTP request. The type of HTTP request can be specified as a parameter, which is by default an HTTP request. The datatype returned is automatically guessed by p5 based on the URL, when it is not specified. The options parameter can be used to spec 4 min read p5.js loadJSON() Function The loadJSON() function is used to read the contents of a JSON file or URL and return it as an object. In case the file contains a JSON array, this function would still return it as an object with the index numbers specifying the different keys of the object. This method can support file sizes up to 3 min read Like