问题描述:

I'm developing a c# application that embeds the Webbrowser control. I create the Website dynamically and use NavigateToString() to display it. I'm on Windows 8 with IE10.

Now my Problem is: Javascript won't execute. For example I added a link that calls alert and another one that calls reset() on a form. Both do nothing. I believe it has to be some security issue because when I say the generated page and open the file manually in IE10 and click one of those links, I get a popup at the bottom that says "Internet Explorer restricted this Webpage from running scripts or ActiveX controls." and a "Allow blocked Content"-button. If I just Close the popup, nothing happens, if I click "Allow blocked Content" the JavaScript works fine.

How can I enable JavaScript in the embedded Webbrowser?

网友答案:

How are you accessing this local website? is it localhost? you need to make the url security friendly so it doesn't get blocked, give it a url http:// localhost:someport instead and it should work

相关阅读:
Top