fcf.load() function
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Loads a resource (file or HTTP/HTTPS) at the given URI.
-
string|object|FormData body - Data sent in the HTTP/HTTPS request body. The request body can be a FormData object, but only for browser-side requests. -
string method = "GET" - HTTP/HTTPS request method ("GET", "POST", etc.) -
boolean|"auto" external = false - By default, if the function is executed on the server side, it downloads only files located on the server side, and if you need to execute an http request, you need to set the parameter totrue or "auto". The external parameter can take the following values:-
false - Server side resource loading is done, only for local files -
true - The resource is loaded on the server side, only via HTTP/HTTPS protocols -
"auto" - Server-side resource loading is performed for both local files and HTTP/HTTPS resources
-
-
bool async = true - If equalstrue . The method is executed asynchronously. If it isfalse , then the method is executed synchronously, but for HTTP/HTTPS, synchronous mode works only on the browser side. -
object header - An object with HTTP/HTTPS request header properties. -
string format - Response data format (raw|json|auto)-
"raw" - The function returns the received string containing the resource data -
"json" - The function returns a JS object received as JSON resource data -
"auto" - The function returns a JS object or string. If the resource returned data in JSON format, the function will return a JS object, if the data cannot be read as JSON, then the function will return a string
-
Output: