Important: Please read the Qt Code of Conduct -

Qt runJavaScript multiple parameters

  • Hi, I'm new here and with QT development

    I'm trying to call a javascript function from C++ and I'm able to pass a parameter as the example below, but I loke to change it to many parameters, is it possible? How can I do it. Thanks

    //QT function calling Js
    webview->page()->runJavaScript("changeHtmlText('Text has been replaced by C++!');");

    //Js Function
    function changeHtmlText(newText)
    { $("#infotext").html(newText); }

    This is and "one" parameter function, I'd like to change it to many parameters

  • @a_d_m
    QWebEnginePage::runJavaScript() executes a JS script, passed to it as a text string. What "many parameters" do you mean?

Log in to reply