How to enable javascript programmatically? RRS feed

  • Question

  • I have a html based dialog, i.e., an MFC dialog that contains html control with active content written in javascript.. The problem is that this dialog doesn't work on client PC with disabled javascript in internet explorer. Is it any way to enable javascript in my situation?
    Wednesday, March 21, 2007 6:35 AM

All replies

  • Hi,


    The best you can do is to add <noscript> tags after your body tag to inform the use that they need scripting enabled in order to use your sidebar.

    Also you should add the Mark of the web to your page to enable the active content without the user being prompted with an information bar.


    Wednesday, March 21, 2007 6:49 PM
  • Hmm, this is not enough for me. The application should work regardless of the current IE settings
    Wednesday, March 21, 2007 7:15 PM
  • Hi,

    Go pure COM instead.

    Wednesday, March 21, 2007 11:25 PM
  • Actually, the dialog is "pure COM"
    In OnInitDialog I create a webbrowser object:
    CoCreateInstance(CLSID_WebBrowser, ..., &spOleObject );
    and connect it to the dialog:
    But still, the problem is that when javascript is disabled in IE, it is also disabled in my dialog. May be there is a call to spOleObject  that enables javascript?
    Thursday, March 22, 2007 5:40 AM