I am using TChromium component on Delphi 10. I need to transfer the text from TMemo to a textarea in html and simulate a click on button on this page.
I have been try it, but doens't work
chromium1.Browser.MainFrame.ExecuteJavaScript('document.all(id_4).value='+Memo1.text+';', '', 0);
Chromium1.Browser.MainFrame.ExecuteJavaScript('id_2.click();', '', 0);
Basically i need this code bellow but using TChromium in Delphi 10. This code bellow is on delphi7 using TWebBrownser.
WebBrowser1.OleObject.Document.all.Item('id_4', 0).value := memo1.Text;
WebBrowser1.OleObject.Document.all.Item('id_2', 0).click;
If your
Memo1contains the text:...then:
...is not valid JavaScript, because
Withis undefined. And the following three tokens plus the dot, too. You have to assign text to it, so in Delphi you have to use:...as literal, because then it becomes valid JavaScript:
Of course: you have to take care of
Memo1's text if it contains a"itself.