Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-08-2009
Member
 
Join Date: Aug 2009
Posts: 2
onUnload event for a side bar

Hi,
I have a sidebar application, which is used for web annotation.
I added the following code for handling the sidebar onload and onunload. When I press the close button, the onUnload event is called. Actually I need a confirm box, containing the text ?Do you want to close the side bar??. Even when I press the cancel, the side bar is closed. How can I set ?Ok? and ?Cancel? options to the window.onUnload event? Is this only applicable for websites? Or Does Sidebar have special event handling for close?

Code:

onLoad: function(e) {
alert(?load?);
},
onUnload: function(e) {
if(confirm(?Do you want to close the sidebar??))
{
alert(?closing?);return true;
}
else
{
alert(?continue?);return false;
}

}
}

window.addEventListener(?load?, function(e) { skratch.onLoad(e); }, false);
window.addEventListener(?unload?, function(e) { skratch.onUnload(e); }, false);
Reply With Quote
  #2  
Old 10-08-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: onUnload event for a side bar

Hey have You check the Last Two Lines , Check the true False Parameter , shouldnt they should be opposite

Quote:
window.addEventListener(“load”, function(e) { skratch.onLoad(e); }, false);
window.addEventListener(“unload”, function(e) { skratch.onUnload(e); }, false);
Well , i dont have any idea , but just give it a try
Reply With Quote
  #3  
Old 10-08-2009
Member
 
Join Date: Aug 2009
Posts: 2
Re: onUnload event for a side bar

I will explain the actual work flow. Actually My website ?http:/localhost? is set as the sidebar url of the sidebar. So when taking the sidebar from the view=>Sidebar menu, and the sidebar loads. On page loading, the datas from the sidebar will get into the ?http:/localhost?. Actually these are done in the website code. like ?window.addEventListener(?myevent", myeventListener, false, true);"
Now I need to check the sidebar close, whether any pop up window is opened or not from the sidebar. If so, I need to catch the close event and need to return false.
When pressing the close button, the page inside the sidebar url will be onunload,,,and even when we put a confirmation into this condition,,the sidebar closes in both cases.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "onUnload event for a side bar"
Thread Thread Starter Forum Replies Last Post
How to get side by side row labels in Excel 2007 Pivot Table The-Farmer MS Office Support 2 15-02-2012 06:01 PM
How to turn on View Side by Side Sheet option in Microsoft Excel Rish!On MS Office Support 2 18-01-2012 05:44 PM
How to open 2 excel files in separate windows to view them side by side Barraq Windows Software 4 16-04-2011 02:49 AM
Application failed to start because it's side by side configuration is incorrect Error in Nero 9.4.26.0 Calebh Windows Software 5 23-03-2010 06:58 PM
Guidelines for Creating Side-by-side Assemblies in Visual Studio 2010 Madhulika Software Development 4 29-01-2010 03:28 AM


All times are GMT +5.5. The time now is 01:24 PM.