Re: Webview RunScript: how to pass a variable to RunScript?

Raphael Stonehorse <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <CAKSMiAPRpGs+-jiPNStm2CrHFS+COj6awfqSitX8wmi8R8r0AA@mail.gmail.com>
For whoever would like to know the solution, which has been given by
DoubleMax in wxWidgets Forum:

wxString txt = "wxWidgets";
wxString script = "let txtS = '" + txt + "';";
RunScript( script );


Il giorno ven 2 feb 2024 alle ore 10:58 Raphael Stonehorse <
[email protected]> ha scritto:

> I would like to pass a variable to RunScript method
>
> With:
>
>         wxString txt = "wxWidgets";
>
>         RunScript("let txtS = `${txt}`");
>
> I get: Error running JavaScript: ReferenceError: Can't find variable: txt
>
> How to do that?
>
>
>

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/CAKSMiAPRpGs%2B-jiPNStm2CrHFS%2BCOj6awfqSitX8wmi8R8r0AA%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.