title: calling a JavaScript function with HTMLUnit
body: <p>I'm trying to call the function <code>showPage('3');</code> of <a href="http://www.visittrentino.it/it/cosa_fare/eventi/risultati?minEventDate=09012014&amp;maxEventDate=31012014&amp;tp=searchForm.thismonth&amp;ltp=gennaio" rel="noreferrer">this page</a>, for use the page source code after. I tried to do with <code>htmlUnit</code> like so: </p>
  
  <pre><code>WebClient webClient = new WebClient();
  
  webClient.waitForBackgroundJavaScriptStartingBefore(10000);
  HtmlPage page = webClient.getPage("http://www.visittrentino.it/it/cosa_fare/eventi/risultati?minEventDate=09012014&amp;maxEventDate=31012014&amp;tp=searchForm.thismonth&amp;ltp=gennaio");
  
  String javaScriptCode = "showPage('3');";
  
  ScriptResult result = page.executeJavaScript(javaScriptCode);
  result.getJavaScriptResult();
  System.out.println("result: "+ result);
  </code></pre>
  
  <p>But it's not working.
  It prints out: </p>
  
  <blockquote>
    <p>result: net.sourceforge.htmlunit.corejs.javascript.Undefined@a303147</p>
  </blockquote>
  
  <p>and other 10000 warnings. What am I doing wrong? I need to change the page of this site for do some crawling on the source code. Is there another way (and maybe more easier) for calling jsp-function from Java code and then navigate in the source of the page? 
  Thank you for any help, have a nice day.</p>