Using executeJavaScript()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using executeJavaScript()

Tony Sterrett
Hello:

I'm trying to execute a piece of JavaScript using executeJavaScript() As i understand it
the function executeJavaScript()  allows you to execute a function within a HTML page.

JavaScript:
   function TermsAccepted() {
        ShowSalesInfo();
    }

function ShowSalesInfo(dt) { $('#divSaleInfo').show(); }
Java code that calls function TermsAccepted

            String javaScriptCode = "TermsAccepted";
            ScriptResult result = htmlPage.executeJavaScript(javaScriptCode);
            result.getJavaScriptResult();
            //result.getNewPage();
            System.out.println("functin result:  "  + result.getNewPage());            
           
The result is:

function result:  HtmlPage(http://www.example.net/sales.html)@80141040

I was hoping to see a new page with Sales Info

Thanks is Advance


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user