Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can details of an HtmlLink be returned using Javascript ?

How can details of an HtmlLink be returned using Javascript ?

The following script will return the Href value for any control which has HtmlLink properties such as a HtmlLink or HtmlImage.

  [ ] INTEGER iSourceIndex = Val (BrowserPage.MyLink.ExecMethod("sourceIndex"))
    [ ] 
    [ ] Print (BrowserPage.ExecLine ("document.all[{iSourceIndex}].href"))

This will return the "Href" property for this control. The href property can be replaced with any of the following:

  • hash - The hash portion of the Href url including the leading #.
  • host - The hostname and port portions of the Href url.
  • hostname - The hostname portion of the url.
  • pathname - The path portion of the Href url
  • port - The port portion of the Href url.
  • protocol - The protocol portion of the Href url including the trailing colon.
  • search - The search or query portion of the Href url.
  • target - The name of the window object (i.e. frame or top level browser window)in which the Href url should be displayed.
  • text - The plain text that appears between the and tags.

e.g.

  [ ] INTEGER iSourceIndex = Val (BrowserPage.MyLink.ExecMethod("sourceIndex"))
    [ ] 
    [ ] Print (BrowserPage.ExecLine ("document.all[{iSourceIndex}].protocol"))

Old KB# 21518

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:21
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.