Object doesn't support property or method WebBrowser Control

前端 未结 3 1149
轮回少年
轮回少年 2020-12-16 15:44

I have developed a mobile app (in asp.net) and I am using a WinForms application with the WebBrowser control to demo it.

I my main page I am using a script to hide t

3条回答
  •  囚心锁ツ
    2020-12-16 16:23

    The Webbrowser control is a part of the Internet Explorer itself. And Internet Explorer doesnt support the window.addEventListener method. Use window.attachEvent method instead.

    So the script in your page will read like

    window.attachEvent("load", function () {
        // Set a timeout...
        setTimeout(function () {
            // Hide the address bar!
            window.scrollTo(0, 1);
        }, 0);
    });
    

    Hope this would help you!

提交回复
热议问题