Skip to main content

OH_NativeArkWeb_LoadData

Function OH_NativeArkWeb_LoadData 

Source
pub unsafe extern "C" fn OH_NativeArkWeb_LoadData(
    webTag: *const c_char,
    data: *const c_char,
    mimeType: *const c_char,
    encoding: *const c_char,
    baseUrl: *const c_char,
    historyUrl: *const c_char,
) -> ArkWeb_ErrorCode
Available on crate feature api-15 only.
Expand description

Loads the data or URL. This function should be called on main thread.

§Arguments

  • webTag - The name of the web component.

  • data - A string encoded according to “Base64” or “URL”, should not be NULL.

  • mimeType - Media type. For example: “text/html”, should not be NULL.

  • encoding - Encoding type. For example: “UTF-8”, should not be NULL.

  • baseUrl - A specified URL path (“http”/“https”/“data” protocol), which is assigned to window.origin by the Web component.

  • historyUrl - History URL. When it is not empty, it can be managed by history records to realize the back and forth function.

§Returns

  • LoadData result code. [ARKWEB_SUCCESS] load data success. [ARKWEB_INVALID_PARAM] Mandatory parameters are left unspecified or Incorrect parameter types or Parameter verification failed. [ARKWEB_INIT_ERROR] Initialization error, can’t get a valid Web for the webTag. [ARKWEB_LIBRARY_OPEN_FAILURE] Failed to open the library. [ARKWEB_LIBRARY_SYMBOL_NOT_FOUND] The required symbol was not found in the library.

Required System Capabilities: SystemCapability.Web.Webview.Core

Available since API-level: 15