Skip to Content
0

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

Feb 17, 2017 at 09:30 AM

134

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

René Ullrich Feb 17, 2017 at 09:55 AM
0

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>
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 17, 2017 at 02:00 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded