Description
Navigates to a specified URL and load the associated page.
Arguments
|
Name |
Type |
I/O |
Description |
|
URL |
String |
In |
The URL of the page to be loaded. |
|
NavFlags |
Long Integer |
In |
The OR of NavMasks constants specifies navigation options. |
|
Nhandle |
Long Integer |
In |
The ObjectHandle of the page providing the context for this navigation action or zero for the current page. |
|
TargetName |
String |
In |
The TARGET specification for this navigation. |
|
TextToPost |
String |
In |
Text to include when using the HTTP POST method or page source when the NavCreateFromText flag is set in NavFlags. |
|
ExtraHeaders |
String |
In |
Additional HTTP headers to be issued with this navigation action. |
Specify NavFlags options by an OR of these NavMasks:
|
NavGet |
&H00000000 |
Use the HTTP GET method |
|
NavPost |
&H00000001 |
Use the HTTP POST method. |
|
NavHead |
&H00000002 |
‘Use the HTTP HEAD method. |
|
NavHiddenLoad |
&H00000004 |
‘Load as a hidden page. |
|
NavNoReadFromCache |
&H00000008 |
‘Do not use a cached copy of this page, load fresh. |
|
NavInFrameContext |
&H00000020 |
‘Treat this hyperlink as if it originated in a FRAME page. |
|
NavDontMakeCurrent |
&H00000400 |
‘Load to cache but don’t make this page current yet. |
|
NavCreateFromText |
&H00002000 |
‘Create the page from text supplied in the TextToPost argument. |
Return Value
Short Integer: zero if load was successfully initiated, else non-zero.
Remarks
In most cases, the nHandle argument can be left zero. To replace a FRAME page which does not have an associated target NAME specification, set the NavInFrameContext bit in the NavFlags argument and set nHandle to the ObjectHandle of the page to be replaced. This causes the hyperlink to be treated as if it had originated in the specified page, replacing that page unless TargetName specifies a different target.
Like all navigation actions, this method results in the BeforeNavigation event being fired. In a BeforeNavigate event handler, you can tell if the action was initiated by your application (the “container”) by inspecting the NavContainerAction bit of the event’s NavFlags argument.
If the requested page is already in cache, it is retrieved from there rather than being loaded unless NavFlags includes NavNoReadFromCache, in which case the cached copy is dismissed and a fresh copy of the page is loaded.
To create a page directly from an input string, set the NavCreateFromText bit in NavFlags and supply the input string in the TextToPost argument. Specify an arbitrary well-formed URL in the URL argument to identify the resulting page.
When NavFlags includes NavHiddenLoad or NavDontMakeCurrent, the control loads the page without providing any indication to the user that this page load is taking place. The activity and status indicators are unaffected, and the new page does not show up in the history list. The container, however, receives all the usual status change events for the page and can apply all page-related methods to the non-visible page.
In most cases, loading a page as the non-current page (NavDontMakeCurrent) is preferred over loading it hidden (NavHiddenLoad) since it avoids the extra complexity of un-hiding the page.
Use the GetHiddenFlag method to find out if a page is hidden and the SetHiddenFlag method to reveal a hidden page.