|
The code below works fine on IE and FF but not on Google Chrome.
Please can someone help me to find out the mistake?.
Flex Code:
Public function init():void
{
ExternalInterface.addCallback("getCloseConfirmMessage", closeConfirmMessage);
ExternalInterface.call("setUpBeforeUnload",FlexGlobals.topLevelApplication.id);
}
Public function closeConfirmMessage():void
{
//DB Updation code
}
Java Script :
<script language="javascript" type="text/javascript">
var fxControl;
function confirmClose()
{
alert("Please click OK to end the session"); fxControl.getCloseConfirmMessage();
};
function setUpBeforeUnload( appName )
{
fxControl = document[ appName ] || window[ appName ];
window.onbeforeunload = confirmClose;
};
</script>
|
|
|
|
|
Have you tried using chrome's developer tools? My guess is a chrome setting is blocking it from loading.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Are you serving this through a web server or from a local file? Chrome (and Chromium) has a security system in place that prohibits local files from running scripts. I think you might have been bitten by that one.
R3J5cGhvbnMgYXJlIGF3ZXNvbWUuIEdyeXBob25zIHJ1bGUh
|
|
|
|