views:

140

answers:

1

I have a native (windows) application that has an embedded web browser. Currently I'm invoking a javascript function from the backend (c++/c#). However, if javascript is disabled this fails and I'd like to provide a fallback mechanism. Is there a way to determine if javascript is disabled?

A: 

In the IE Web Control, you can simply force JavaScript on. Please refer to the following interfaces, which your host has to implement:

  • IDocHostUIHandler
  • IDocHostShowUI
  • IInternetSecurityManager
  • IServiceProvider

Another approach would be for your HTML page to query the window.external object and call a method on it, which you implement in your host, which sets a flag to true. Not being called would mean the JavaScript was not executed.

Alexander Gräf
The IInternetSecurityManager was just what I needed. I found a nice explination of how to implement it here... http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/c6b9bfbb-12b4-47f8-8dda-c89646358f52
herbrandson