I cannot call javascript function from QT.
I am using the code below
QT Code:
QWebFrame *frame = m_d->m_webView->page()->mainFrame(); frame->evaluateJavaScript("displayhello()");
Here `displayhello()` is the `Javascript` function defined in the HTML file.
HTML code:
<html> <head> <script type="text/javascript" src="" /> <script type="text/javascript"> function displaymessage(str) { alert(str); } function displayhello() { alert("Hello"); } </script> </head> <body> <form> <input type="button" value="Click me!" onClick="displayhello()"> </form> </body> </html>
Could someone give me any directions why the Javascript function is not called.
tarun source share