Run Javascript on Webbrowser with Delphi

Asked

Viewed 2,283 times

0

I created a robot in Delphi to open a website and include the data automatically.

I’m having trouble calling a Javascript routine that has on this site, as below:

<script type="text/javascript">
function prepararInclusaoItem(id) {
    myForm = document.getElementById('faturaForm');
    myForm.action='faturamentoPrepararInclusaoItem.do';
    myForm.id.value = id;
}
function excluirItem(codigo) {
    if(confirm('Deseja realmente excluir este Item de Pagamento?')) {
        navegarPara('ExcluirItem', codigo);
    }
    return false;
}
</script>

And to access the record has the routine that calls the script :

  • 1

    What’s the matter?

  • Dude, I don’t know if you can fire these methods in Javascript. But it seems to me, are 2 objects that will include and delete something. So ,you could shoot for Delphi, the action of that particular object (assuming it’s a button)

2 answers

-1

I used the command:

WebBrowser1.EvaluateJavaScript(vvScript);

Worked!

-1

There Is This Way: WebBrowser1.EvaluateJavaScript('NomeDaFunction');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.