/    Sign up×
Community /Pin to ProfileBookmark

error: stack overflow at line 1797

stack overflow at line 1797

hello i have this error when i run my java script calendar.
any tips?
thanks

to post a comment
JavaScript

17 Comments(s)

Copy linkTweet thisAlerts:
@bals28mjkSep 07.2007 — Can you supply us with more information?
Copy linkTweet thisAlerts:
@mrhooSep 08.2007 — Usually javascript caused stack overflows happen when you have a function that calls another function that calls the first function- recursion.

Accessing an array index that is too large will usually get caught by the browser with a message like 'Not enough Stack Space' or 'Invalid Array', but that is another possibility.

There are also OS stack overflows, but they usually crash or freeze the application running the stack, and any error message will come from the OS, and not the browser.
Copy linkTweet thisAlerts:
@hoangkcSep 08.2007 — please show some code around line 1797.

maybe it is just a zero-divide
Copy linkTweet thisAlerts:
@silviasalsaauthorSep 10.2007 — <!---- this happens after i open the calendar and i click on a DAY ---------->


If you need anymore info please let me know.

thanks

[upl-file uuid=75831500-a129-40a6-9153-f2f6e1e9d6c0 size=50kB]calendar.txt[/upl-file]
Copy linkTweet thisAlerts:
@FangSep 10.2007 — Those aren't JavaScript comments

What are you doing when the error occurs?
Copy linkTweet thisAlerts:
@silviasalsaauthorSep 10.2007 — Thanks

but what info do we need so we can resolve this issue?

again

thanks
Copy linkTweet thisAlerts:
@FangSep 10.2007 — Preferably a site link and when does the error occur.
Copy linkTweet thisAlerts:
@silviasalsaauthorSep 11.2007 — cannot provide you the link

hope this helps.


it happens when i after i click on a date (DAY) for example day 6.

when i click on the textbox (works)

then the calendar pops up (works)

it happens when i after i click on a date (DAY) for example day 6.
Copy linkTweet thisAlerts:
@silviasalsaauthorSep 11.2007 — thanks so far i have seen it.

what do they mean by wrap?

and what do add change on the js files?
-----------------------

Copy linkTweet thisAlerts:
@FangSep 12.2007 — Change to this beginning at line 1797:<i>
</i>if ( Date.prototype.__msh_oldSetFullYear == null )
{
Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
}
var d = new Date(this);
d.__msh_oldSetFullYear(y);
if (d.getMonth() != this.getMonth())
this.setDate(28);
this.__msh_oldSetFullYear(y);
};
Copy linkTweet thisAlerts:
@silviasalsaauthorSep 12.2007 — where in this code?

where ? in this code? or the one attached?
------------------------------------------




<cfif ListFindNoCase(variables.ListOfEntriesToShow,"DateHours") or ListFindNoCase(variables.ListOfEntriesToShow,"all")>
<tr>
<td align="right" valign="baseline" width="40%"><strong>Worked Date:</strong></td>
<td valign="top">From
<input type="text" name="startdate" size="10" id="sdate">
<input type="image" src="images/calendar.gif" id="f_trigger_a" >
<script type="text/javascript">
Calendar.setup({
inputField : "sdate", //*
ifFormat : "%m/%d/%Y",
showsTime : true,
button : "f_trigger_a", //*
step : 1
});
</script>

&nbsp;&nbsp;&nbsp;To
<input name="enddate" type="text" size="10" id="edate">
<input type="image" src="images/calendar.gif" id="f_trigger_b" >
<script type="text/javascript">
Calendar.setup({
inputField : "edate", //*
ifFormat : "%m/%d/%Y",
showsTime : true,
button : "f_trigger_b", //*
step : 1
});
</script>
</td>
</tr>
</cfif>


[upl-file uuid=30818ef7-882a-4573-9ebd-614e608620e6 size=50kB]calendar.txt[/upl-file]
Copy linkTweet thisAlerts:
@FangSep 12.2007 — At line 1796
Copy linkTweet thisAlerts:
@silviasalsaauthorSep 12.2007 — i have changed the code with your help but when i click on the calendar, it goes directly to the report.

meaning that the calendar does not pop up.

i changed it to :
--------------------------------------------------------------------------



if ( Date.prototype.__msh_oldSetFullYear == null )

{

Date.prototype.__
msh_oldSetFullYear = Date.prototype.setFullYear;

}

var d = new Date(this);

d.__msh_oldSetFullYear(y);

if (d.getMonth() != this.getMonth())

this.setDate(28);

this.__
msh_oldSetFullYear(y);

};
Copy linkTweet thisAlerts:
@FangSep 12.2007 — Your best bet is to ask on the Dynarch forum, although considering this fix was posted in 2005 and not yet changed in the source code, it may not be the correct solution.

Make sure you have set-up the calender correctly and that there are no conflicts with other functions.
Copy linkTweet thisAlerts:
@ashes_onfireAug 21.2008 — I ran into exactly same problem,

tried all sorts of tricks but ended up with fixing the problem by turning smart navigation off.

I've already heard a lot about the problems with smart navigation.

you can check if thats what your problem is

cheers
Copy linkTweet thisAlerts:
@jahkeyJun 23.2010 — silviasalsa is correct except that there is a little syntax error

go to around line 1797 of calendar.js

and replace the code snippet

from

Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;

Date.prototype.setFullYear = function(y) {

var d = new Date(this);

d.__
msh_oldSetFullYear(y);

if (d.getMonth() != this.getMonth())

this.setDate(28);

this.__msh_oldSetFullYear(y);

};


to

if ( Date.prototype.__msh_oldSetFullYear == null ){

Date.prototype.__
msh_oldSetFullYear = Date.prototype.setFullYear;

}

var d = new Date(this);

d.__msh_oldSetFullYear(y);

if (d.getMonth() != this.getMonth())

this.setDate(28);

this.__
msh_oldSetFullYear(y);


silviasalsa had just pasted an extra line at the end of the line

It will work on firefox and on IE

there will be an unprompted error in IE but it will still work fine.

?
×

Success!

Help @silviasalsa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...