« Return to Thread: "Form" is not a constructor

"Form" is not a constructor

by Thomas Robbs :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

I’ve recently come across a problem when the JavaScriptEngine.execute(…) method executes the following line of JavaScript:

 

currentForm = document.getElementById("formName");

 

… where “formName” is the id of a form on the page.

 

The exception that is thrown is:

 

org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: "Form" is not a constructor. (javascript file name#105) (javascript file name #105)

 

I’m using the following BrowserVersion:

 

    public static final BrowserVersion IE_6_0_SP2_on_WINXP_SP2 = new BrowserVersion(

        BrowserVersion.INTERNET_EXPLORER, "4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)",

        "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)", "1.2", 6 );

 

I’ve walked through the functionality using the real browser that the above BrowserVersion represents as well as FireFox 1.0.7 and I’m not seeing any JavaScript errors on the page when it loads.

 

I’m also using a build of HtmlUnit 1.7 from 2005-12-05.

 

Any ideas as to what would cause this Exception?

 

Thanks in advance,

 

Tom

 

 

 « Return to Thread: "Form" is not a constructor