Q
|
I prefer to use server-side JScript for my ASP scripting instead of VBScript. But when calling the GetExtPropertiesEx method I am receiving the following error: "The BrowserHawk GetExtPropertiesEx method is only available when used with ASP (no Context is available)". Everything works fine if I use VBScript instead of JScript.
|
A
|
This is a common question from developers using JScript. The problem occurs because typically the developer uses the "New ActiveXObject" approach to creating the cyScape.BrowserObj.
As a result of that syntax, an instance of BrowserHawk is created in isolation from the ASP context associated with the page the component is running under. Therefore the component does not have the resources it needs to perform the requested checks.
The solution is easy - just use the Server.CreateObject syntax instead of New ActiveXObject.
For example, do NOT do this:
var bhObj = New ActiveXObject("cyScape.browserObj")
instead, do this:
var bh = Server.CreateObject("cyScape.browserObj")
This will resolve the issue.
|