我无法从QT中调用javascript函数。
我正在使用以下代码:
QT代码:
QWebFrame *frame = m_d->m_webView->page()->mainFrame();
frame->evaluateJavaScript("displayhello()");
Here `displayhello()` is the `Javascript` function defined in the HTML file.
HTML代码:
<html>
<head>
<script type="text/javascript" src="" /></script>
</head>
<body>
<form>
<input type="button" value="Click me!" onClick="displayhello()">
</form>
</body>
</html>
有人能告诉我为什么JavaScript函数没有被调用吗?