Problem:
* "window.event.returnValue=x" >> does not work at every place in the code.
* "window.event.returnValue=false;" >> Works always fine when it is NOT inside the "e.onerror = function()" or inside the e.onload = function()"
Q: why it is working fine when the "event.returnValue=false;" is placed inside the "OnClickDone() but does not work when it is placed inside the e.onerror/e.onload functions?
The code with explanation of the problem:
function OnClickDone()
{
var i = 0;
var e = document.createElement("img");//try to load img
e.src = "e.onerror = function()//can't load, so return event false.
{
window.event.returnValue=false;//does not work >>(the next page should not be loaded)
alert("OFF Line");//works fine
e = null;
};
e.onload = function()
{
window.event.returnValue=true;// it passes here, but does not do it.
alert("ON Line");//work fine
e = null;
};
Thanks,
* "window.event.returnValue=x" >> does not work at every place in the code.
* "window.event.returnValue=false;" >> Works always fine when it is NOT inside the "e.onerror = function()" or inside the e.onload = function()"
Q: why it is working fine when the "event.returnValue=false;" is placed inside the "OnClickDone() but does not work when it is placed inside the e.onerror/e.onload functions?
The code with explanation of the problem:
function OnClickDone()
{
var i = 0;
var e = document.createElement("img");//try to load img
e.src = "e.onerror = function()//can't load, so return event false.
{
window.event.returnValue=false;//does not work >>(the next page should not be loaded)
alert("OFF Line");//works fine
e = null;
};
e.onload = function()
{
window.event.returnValue=true;// it passes here, but does not do it.
alert("ON Line");//work fine
e = null;
};
Thanks,