I'm trying to use evaluateJavaScript() to call some js function on the page I'm logged into. Calling this function should initiate ajax call to retrieve data. When I call it from within Firebug (Firefox's plugin) I can see network traffic initiated and data downloaded. When I do the same programmatically using evaluateJavaScript() nothing happens. I'm fighting with this for the last 3 days... Any help would be much appreciated. Thanks in advance.

Things I tried;

1. I tried also QWebElement::evaluateScript() on the element which has the js function. This element is an anchor and it looks like this
<a class="InfoLink" href="javascript:mySelectHandler('X','290 877',32,'0','','','')">290 877</a>
2. I tried evaluating this js function from within Web Inspector and got "undefined" in response which I take as function was called successfully with no result returned.

3. I wrote ugly method to click on given element which you can see below. WebPage inherits from QWebPage. It doesn't work in this case as well.

Qt Code:
  1. void
  2. WebPage::clickElement(QWebElement element)
  3. {
  4. QPoint clickPoint = element.geometry().center();
  5. QMouseEvent * buttonPress =
  6. new QMouseEvent(QEvent::MouseButtonPress,
  7. clickPoint,
  8. Qt::LeftButton,
  9. Qt::LeftButton,
  10. Qt::NoModifier);
  11.  
  12. QMouseEvent * buttonRelease =
  13. new QMouseEvent(QEvent::MouseButtonRelease,
  14. clickPoint,
  15. Qt::LeftButton,
  16. Qt::LeftButton,
  17. Qt::NoModifier);
  18.  
  19.  
  20. event(buttonPress);
  21. event(buttonRelease);
  22. }
To copy to clipboard, switch view to plain text mode