WebPageAddUrl Function

Action

This function specifies an additional URL to be downloaded by the next page-level web function call (e.g.: WebPageUrl, WebPageLink).

This function specifies an additional URL to be downloaded by the next page-level web function call (e.g.: WebPageUrl, WebPageLink). This can be used to simulate the loading of documents done by JavaScript or applets.

Note: This function does not perform any network requests. The subsequent WebPage function call will include this URL in the Web page download. Thus, the page download timer will correctly include the download of these documents.

Include file

WebAPI.bdh

Syntax

WebPageAddUrl(in sUrl : string,
              in formUrl : form optional,
              in nCount : number optional) : boolean;

Return value

  • true if the URL was added successfully

  • false otherwise

Parameter Description
sUrl Absolute or relative URL to the file on the server. All characters that are part of the query string are not URL-encoded. A relative URL is resolved to an absolute URL base on the URL that is downloaded by the next page-level Web API function call.
formUrl Form identifier used in the dclform section (optional). The expanded form string is appended to the URL after the "?". All unsafe characters are URL-encoded.
nCount The specified URL is added nCount times.

Example

dcltrans
transaction TMain
begin
  // absolute URL
  WebPageAddUrl("http://adimages.lab3/advertisement.gif");
  // relative URL, absolute path - downloads: "http://lab3/images/banner.gif"
  WebPageAddUrl("banner.gif");
  // relative URL, query string, 3 times
  // downloads: "http://lab3/images/product.asp?code=2"
  WebPageAddUrl("product.asp", SHOPIT_PRODUCT_ASP002, 3);
  WebPageUrl("http://lab3/shopit/", "ShopIt - Product");
end TMain;
dclform
  SHOPIT_PRODUCT_ASP002:
    "code" := "2";