Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Qt runJavaScript multiple parameters
Forum Update on Monday, May 27th 2025

Qt runJavaScript multiple parameters

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 2 Posters 634 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a_d_m
    wrote on 8 Oct 2019, 20:24 last edited by
    #1

    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

    J 1 Reply Last reply 8 Oct 2019, 21:12
    0
    • A a_d_m
      8 Oct 2019, 20:24

      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

      J Offline
      J Offline
      JonB
      wrote on 8 Oct 2019, 21:12 last edited by JonB 10 Aug 2019, 21:19
      #2

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

      1 Reply Last reply
      0

      1/2

      8 Oct 2019, 20:24

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved