g.getFullYear is not a function

2,341 views
Skip to first unread message

Greg

unread,
Oct 20, 2009, 10:01:15 PM10/20/09
to Firebug
Hello,

So I'm debugging some javascript on a site I'm working on, in one part
I get the current year with getFullYear(). The value seems to be
coming out correct, but firebug keeps telling me that g.getFullYear is
not a function in the console view. The only line I use getFullYear
is:

function getCurrentYear() {
today = new Date();
return today.getFullYear();
}

Any suggestions on what I'm missing?
I'm using Firefox 3.5.3 on Vista 64 Home. Any suggestions are welcome.

Thank you for your time

John J Barton

unread,
Oct 20, 2009, 11:35:38 PM10/20/09
to Firebug


On Oct 20, 7:01 pm, Greg <gvisca...@gmail.com> wrote:
> Hello,
>
> So I'm debugging some javascript on a site I'm working on, in one part
> I get the current year with getFullYear(). The value seems to be
> coming out correct, but firebug keeps telling me that g.getFullYear is
> not a function in the console view. The only line I use getFullYear
> is:
>
>         function getCurrentYear() {
>                 today = new Date();
>                 return today.getFullYear();
>         }
>
> Any suggestions on what I'm missing?

Yes, the source line that includes the string "g.getFullYear()".
Also try Console > mini-menu options > Show stack trace.

Also try with only one tab open in Firefox.

jjb

The error message should be linked to the source line;

Greg

unread,
Oct 21, 2009, 12:15:28 PM10/21/09
to Firebug
On Oct 20, 11:35 pm, John J Barton <johnjbar...@johnjbarton.com>
wrote:
There is no source line in my code that includes "g.getFullYear", the
stack trace shows:

g.getFullYear is not a function
anonymous(Object date=2009-10-18 dateOnly=false setDateOnly=true)
core,med...ault.I.js (line 86)
anonymous()core,med...ault.I.js (line 109)
anonymous()core,med...ault.I.js (line 109)
anonymous(Object, listEvents(feedRoot), handleGDError(e), function(),
Object name=l, Object)core,med...ault.I.js (line 121)
anonymous(Object, listEvents(feedRoot), handleGDError(e), Object
name=h)core,med...ault.I.js (line 635)
loadCalendar("http://www.google.com/calendar/feeds/
b0qd76la61rre...@group.calendar.google.com/public/full")
index.php?m=store (line 105)
index.php?m=store()

Now I've searched through every line of code in my files and have
found no reference to g.getFullYear, and only 1 reference to
getFullYear, which I posted earlier. I've tried with the site being
the only tab in firefox, but still same situation. And the message
does not take me to any source line, only opens/closes the stack trace
tree. Thank you for your suggestions but unless I have misinterpreted
them (which is possible) I don't believe they have helped so far.

John J Barton

unread,
Oct 21, 2009, 12:36:21 PM10/21/09
to Firebug
Line 86 for this file is where the error is.

jjb


> anonymous()core,med...ault.I.js (line 109)
> anonymous()core,med...ault.I.js (line 109)
> anonymous(Object, listEvents(feedRoot), handleGDError(e), function(),
> Object name=l, Object)core,med...ault.I.js (line 121)
> anonymous(Object, listEvents(feedRoot), handleGDError(e), Object
> name=h)core,med...ault.I.js (line 635)
> loadCalendar("http://www.google.com/calendar/feeds/
> b0qd76la61rres05lt7cc30...@group.calendar.google.com/public/full")
> index.php?m=store (line 105)
> index.php?m=store()

Looks like an AJAX call.
Reply all
Reply to author
Forward
0 new messages