Rank: Newbie Groups: Member
Joined: 10/29/2007 Posts: 4
|
Hey guys, I was wondering if you could help me with a quick issue that I'm having.
I have window.onbeforeunload on a page. When I select an item from the eo:Menu to navigate away from the page I see the onbeforeunload window as expected. If I click "Ok" everything works fine and the page navigates. If I click "Cancel" an unhandled exception is recieved. It is failing at this location:
function _eofu_co(a,b){if(!b||(b=="_self"))window.location.href=a;
Thanks in advance.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, You will want to use ClientSideOnItemClick instead of onbeforeunload to confirm whether user wants to leave the current page:
Code: HTML/ASPX
<eo:Menu ruant="server ClientSideOnItemClick="on_item_click" ....>
......
</eo:Menu>
Code: JavaScript
function on_item_click(e, info)
{
if (!window.confirm("Are you sure"?))
eo_CancelEvent();
}
onbeforeunload always causes an exception when canceled while navigating away from the current page by script. So you want to avoid using that with our menu because our menu navigate away from the current page by script. Thanks
|