I would like to run javascript on HTML generated from C# string. (without opening browser - just C# code)
Something like:
string myHTML = '<div id="divTest">This is test<br/><br/></div>';
Javascript should be:
function test
{
return document.getElementById('divTest').offsetHeight;
}
What I've already tried is check some headless browsers like PhantomJS and Optimus - but they don't have an option to render string (only to open web page through web address like http://google.com/. Is there a way to achieve this through C#?