Javascript browser compatible issue

Javascript browser compatible issue

  

Hi,

i am using RunJavascript to run a javascript blocking user from go back previous page by using browser back button.
It is working in chrome but it is not working in lower version of IE, ie: IE 9 and below.
It shows error: An exception occurred in the client script. Error: Object doesn't support property or method 'pushState'

Does anyone know how to solve this problem?

This is the script:

SyntaxEditor Code Snippet

"history.pushState(null, document.title, location.href);

 

window.addEventListener('popstate', function (event) {

  history.pushState(null, document.title, location.href);

  alert('Please use the buttons within the system to navigate through the system.');

});"


Solution

Hey


IE 9 and earlier does not support history.pushstate and history.replacestate,

maybe you will have to use some jquery to make it work


VC

Solution

Hi Vincent,

Mat i know how to use jquery in outsystems? Can i use RunJavascript to run jquery script directly?

Hi WEI LUN WONG,

You can write your jquery code in RunJavaScript function directly.