I have a better solution.
Server Side
When there is error, you append a query parameter like error=1
to the end url.
If you have a page like nettpals.in/default
, after encountering a error, you append a query string like: nettpals.in/default?error=1
(I don't know of how to do it in Windev, in fact I haven't even heard of it ! But you know what you are doing :))
Client Side
Use this javascript:
window.onload=function(){
if(getParameterByName('error')=='1'){
// do something
}
}
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
What does it do ?
First, if an error occurs, you append a query string error=1
to the url. In the client,
you are checking if the url has the error
parameter. If so, it automatically executes the code that is inside the if
condition.
Note: Replace the comment // do something
with your code. AND since this code works on onload
event, you won't need to trigger it(eg: with a button)