Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The code below works fine on IE and FF but not on Google Chrome. 
Please can someone help me to find out the mistake?.Thanks In Advance.


Flex Code: 
Public function init():void
{
ExternalInterface.addCallback("getCloseConfirmMessage", closeConfirmMessage);
	
ExternalInterface.call("setUpBeforeUnload",FlexGlobals.topLevelApplication.id);
}
Public function closeConfirmMessage():void
{
	//DB updation code  
}


XML
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>
Posted
Comments
Sandeep Mewara 29-Jan-13 12:11pm    
What do you see when you debug?
Flex_Query 29-Jan-13 22:45pm    
Need to show the alert message and as well as update the value to database while closing the application.

1 solution

You already posted this question at http://www.codeproject.com/Messages/4483148/Java-Script-is-not-working-in-Chrome.aspx[^]. Please post in one forum only.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900