CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why I got stack overflow when using the calendar with the dragdrop script lib from www.walterzorn.com?

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> CalendarXP F.A.Q.
View previous topic :: View next topic  
Author Message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Mon Jul 31, 2006 9:44 pm    Post subject: Why I got stack overflow when using the calendar with the dragdrop script lib from www.walterzorn.com? Reply with quote

It's because there is a bug in the wz_dragdrop.js file from www.walterzorn.com. You may fix it by removing the line 1326 of the wz_dragdrop.js - it's the last line of function SET_DHTML(), as following:

Code:
function SET_DHTML()
{
...
dd.setDwnHdl(PICK); <--- REMOVE this line of code
}


The reason behind is the setDwnHdl() already gets called in the dd.initz() which is initialized during window.onload(). Calling it twice will results in endless recursion if the page's onmousedown also setup by other scripts.

Although the author had added a check in setDwnHdl() trying to avoid such recursion within the scope of dragdrop lib itself, the check was not enough as it didn't take into consideration that the page could have external onmousedown assigned.

To prove it quickly, you may take any orignal demo from www.walterzorn.com and add the following code to page:

<script>
document.onmousedown=function(){alert("you should see me once only.");}
</script>

Now you click on page - you'll see 2 alerts instead of 1 per click - due to the bug. If replacing the alert with a common event preservation logic, like the one used in calendarxp, you will end up with stack overflow because the 1st call sets up the correct preservation and the 2nd one created a recursion loop with no end.

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> CalendarXP F.A.Q. All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group