Skip to Content
avatar image
Former Member

How to suppress the script error within powerbuilder code when we used the ole control.

I am getting some script errors like below when we are using MicrosoftWebbrowser ole control to open some other app link within powerbuilder application.

'Object doesn't support property or method 'addEventListener'

'Object doesn't support property or method 'replaceState'

Please help me if there is any way to suppress the script errors or to handle these within powerbuidler code itself

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 17, 2017 at 09:55 AM

    The best way is to do changes to avoid errors. :-)

    If you only want to hide them:

    If this errors are ole control errors you could try to code the events error and externalexception of ole control. Or use a Try-Catch-Block to catch the exceptions.

    If the errors are javascript errors only shown in the browser control you can try to add a error handler in webpage.

    <script type="text/javascript">
        window.onerror = function(message, url, lineNumber){return true;};
    </script>
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 17, 2017 at 02:00 PM

    The Web Browser Control defaults to IE 7 mode. Those methods aren't supported by IE 7.

    There is a way to change the version mode:

    https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation

    Add comment
    10|10000 characters needed characters exceeded