How to insert C # string in CefSharp script

0

How can I insert a c # string into the script?

string teste = "testando";

chromeBrowser.ExecuteScriptAsync("$(document).ready(function() {alert({0})}); ", teste); 

I tried this code but it did not return anything

    
asked by anonymous 30.05.2018 / 22:01

1 answer

0

The script you are trying to run is in the jquery syntax, the page will probably not recognize this of course, so I suggest you write javascript purely for this, an example would be to do this:

script = "document.addEventListener('DOMContentLoaded', function(){ alert('qualquer coisa'); });";

Still, if you want to use jquery, I suggest following the link .

    
31.05.2018 / 04:07