Hello, I'm trying to inject some javascript to page loaded by WebBrowser, but I'm not able to run this script :/ Any help ?

Code:
this->browser->Document->Body->InnerHtml += "<script type='text/javascript'>function validateTest(){ alert('hi there') }</script>";
this->browser->Document->InvokeScript("validateTest");