0

This snippet just makes IE7/IE8 crashes the page throwing error. I don't know why cause on chrome / FF, everything is fine.

http://jsfiddle.net/Zrz9t/15/

The problem seems to be here :

            return event.Date.valueOf() === date.valueOf();

The error is :

Message: 'Date' has value Null or is not an object

What's causing this ? Thanks

EDIT I updated my code here http://jsfiddle.net/Zrz9t/15/

sf_tristanb
  • 8,267
  • 16
  • 67
  • 114

4 Answers4

2

That script works fine in FF4 and IE8.

However, IE is picky about reserved words. Try renaming "Date" to something else.

Udo G
  • 11,022
  • 11
  • 47
  • 77
  • I changed the name of the var (to StartDate) without no result. Will try updating jQuery – sf_tristanb Apr 11 '11 at 09:52
  • After adding `id="div"` to the HTML code I can click to a yellow cell and (ie. April 13th) and get a 404 error because it tries to load "http://fiddle.jshell.net/_display/Five%20K%20for%20charity". – Udo G Apr 11 '11 at 10:03
  • Sory, wrong code update, i've put back the alert(event.Title) – sf_tristanb Apr 11 '11 at 10:05
  • Works fine for me with IE 8.0.7601.17514 64-bit edition after fixing your `
    ` code to `
    `
    – Udo G Apr 11 '11 at 10:08
0

Please check whether the Date is null.when you are trying to get the valueOf a null object it is throwing the error.

Ammu
  • 4,607
  • 9
  • 31
  • 34
0

Ok, the problem was the following :

    var events =[
{ Url : "azerty", StartDate : new Date("04/17/2011") } ,
{ Url : "azerty2", StartDate : new Date("04/17/2011") } ,
]; 

Notice the last comma on the last line (which wasn't present on JsFiddle).

IE was the only one to yell at me for that extra comma.

Problem solved.

sf_tristanb
  • 8,267
  • 16
  • 67
  • 114
-1

event is probably a reserved keyword in IE, try changing it to something else.

Nishan
  • 2,721
  • 4
  • 24
  • 36